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

ohnobinki’s picture

Status: Active » Needs review
Issue tags: +Needs backport to D7
StatusFileSize
new2.06 KB

This 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-content and clicking Edit producing a DOM exception. Now, instead of a DOM Exception and my browser navigating to the http://ohnopub.net/drupal8/node/2/edit page, it opens the Edit tab in an overlay screen.

This exact same bug exists in D7. Currently this patch applies fine to D7. $ git am compatible too, if only core people noticed that git is a DVCS :-p.

kscheirer’s picture

Status: Needs review » Needs work

Not sure why testbot ignored this patch, but it definitely needs to be rerolled against head if this issue still needs fixing.

nod_’s picture

Version: 8.x-dev » 7.x-dev
Issue summary: View changes

Overlay is dead to D8 #2088121: Remove Overlay.

sivaji_ganesh_jojodae’s picture

Status: Needs work » Needs review
StatusFileSize
new1.67 KB

Attached patch for d7.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.