Project

General

Profile

Bug #1753

Showing a modal from an AJAX request that returns a full-blown HTML page clears the page

Added by Olivier Favre about 7 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Web Interface
Target version:
Difficulty:
Triaged:
No
Bugzilla link:
Pull request:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

How to reproduce:

Edit a host, get a conflict: this displays an error info in a modal dialog.
Ack then overwrite: it should have shown another error info in a modal dialog too,
but instead of an HTML fragment, foreman gave a full HTML page (with html, head and body) as an answer to some AJAX query,
this has the nasty effect of clearing the page, only showing "2012".

Clue:

$.ajax({
  [...],
  success: function(result) {
    # If result is an HTML fragment, everything is fine
    # if it is a full HTML page, this will somehow clear the page and show "2012"...
    $('#modal-frame-content').html(result);
  }
});

This is a general problem that can arise with code like the above.

Associated revisions

Revision 72da1d77 (diff)
Added by Amos Benari about 7 years ago

fixes #1753 - Showing a modal from an AJAX request that returns a full-blown HTML page clears the page

History

#1 Updated by Ohad Levy about 7 years ago

can you provide the logs from foreman while doing the request?

#2 Updated by Romain Vrignaud about 7 years ago

  • Priority changed from High to Normal

#3 Updated by Ohad Levy about 7 years ago

this seems to happen only when the response is 404.

and I'm guessing its related to when renaming a host.

#4 Updated by Amos Benari about 7 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF