overlay-parent.js's Drupal.overlay.redirect() function uses String.link() to generate an anchor tag. This function produces invalid results, particularly when given a URL with invalid entities in it:
js> var url = 'http://ohnopub.net/?test&blah';
js> print(url.link(url));
<a href="http://ohnopub.net/?test&blah">http://ohnopub.net/?test&blah</a>
js> quit()
ohnobinki@ohnopublishing ~ $ js --version
JavaScript-C 1.7.0 2007-10-03
usage: js [-PswWxCi] [-b branchlimit] [-c stackchunksize] [-v version] [-f scriptfile] [-e script] [-S maxstacksize] [scriptfile] [scriptarg...]
ohnobinki@ohnopublishing ~ $
I can see the same behavior in my browser, resulting in a DOM exception when browsing to a page with a fragment in it:
Error: not well-formed
Source File:
Line: 1, Column: 106
Source Code:
<div xmlns="http://www.w3.org/1999/xhtml"><a href="http://ohnopub.net/drupal/node/6#main-content=&overlay=node/6/edit">http://ohnopub.net/drupal/node/6#main-content=&overlay=node/6/edit</a></
is produced when clicking the Edit link and starting out from http://ohnopub.net/drupal/node/6#main-content (column 106 is at the equal sign in of &overlay=. Also, I have to specially wire up drupal with Content-Type: application/xhtml+xml to get these exceptions).
Also, Mozilla's docs state that String.link() is non-standard.
Comments
Comment #1
ohnobinki commentedThis patch adds another function to Drupal.overlay which replaces the functionality which String.link() is used for. It fixes the scenario of being at
http://ohnopub.net/drupal8/node/2#main-contentand clicking Edit producing a DOM exception. Now, instead of a DOM Exception and my browser navigating to thehttp://ohnopub.net/drupal8/node/2/editpage, it opens the Edit tab in an overlay screen.This exact same bug exists in D7. Currently this patch applies fine to D7.
$ git amcompatible too, if only core people noticed that git is a DVCS :-p.Comment #2
kscheirerNot sure why testbot ignored this patch, but it definitely needs to be rerolled against head if this issue still needs fixing.
Comment #3
nod_Overlay is dead to D8 #2088121: Remove Overlay.
Comment #4
sivaji_ganesh_jojodae commentedAttached patch for d7.