diff --git a/core/misc/ajax.js b/core/misc/ajax.js index b63bc03..02aaa0e 100644 --- a/core/misc/ajax.js +++ b/core/misc/ajax.js @@ -911,9 +911,16 @@ // top-level element, and only use the container DIV created above when // it doesn't. For more information, please see // https://www.drupal.org/node/736066. - if (new_content.length !== 1 || new_content.get(0).nodeType !== 1) { + + if (new_content.get(0).nodeType == 1) { + new_content.unwrap(); + } + else if(new_content.get(0).nodeType !== 1 && new_content.length !== 1){ new_content = new_content_wrapped; } + else{ + return; + } // If removing content from the wrapper, detach behaviors first. switch (method) {