(So far as I can tell, this question hasn't been asked.)

When overlay is in core, at least as currently implemented, we will always have to account for URLs like this:

http://localhost/drupal7/#overlay=admin%2Fconfig%2Fmodules

and like this:

http://localhost/drupal7/admin/config/modules

both leading to the same set of functions; the first as a modal dialog from a hash, and the second as a page.

This would seem to be a recipe for confusion on the part of documenters, at least -- which URL is canonical? Are both? When I want to embed an admin link in a post, which should I use? And if I want to make an admin URL the object of an RDF statement, which one do I use? Do I make two statements, with a third to say the two URLs represent the same resource? And if the answer is "Use the URL to which Drupal gracefully degrades," does that not imply that overlay should not be in core?

One can also imagine users posting URLs in mail, or in support requests, and confusion arising because one user has overlay enabled, and the other does not.

I know there's no rule that says that a single resource can't have many URLs that locate it, but to build two different syntaxes for locating core functionality into core... Seems disquieting. Especially since Drupal's RESTful-ness has been a great attraction for me.

Roy Fielding writes:

The definition of resource in REST is based on a simple premise: identifiers should change as infrequently as possible. Because the Web uses embedded identifiers rather than link servers, authors need an identifier that closely matches the semantics they intend by a hypermedia reference, allowing the reference to remain static even though the result of accessing that reference may change over time. REST accomplishes this by defining a resource to be the semantics of what the author intends to identify, rather than the value corresponding to those semantics at the time the reference is created. It is then left to the author to ensure that the identifier chosen for a reference does indeed identify the intended semantics.

I'm concerned that because we've got two ways of identifying the same bundle of functionality, assuming such to be a resource (one for modal overlay, one for page) we've made "the semantics of what the author intends to identify" unclear (which is a fancier way of saying "confusing," as in the examples above).

Comments

David_Rothstein’s picture

I was thinking about this the other day but did not file an issue - thanks for doing so :)

For documentation purposes, I think it's definitely the case that http://localhost/drupal7/admin/config/modules should be used. Perhaps the overlay module will wind up auto-redirecting that to http://localhost/drupal7/#overlay=admin/config/modules to force it to appear in the overlay for users who have appropriate permissions (there are a variety of reasons why that should make sense), but the standard URL should be used in documentation.

The opposite direction: I definitely agree that's a problem. We do not want people passing around URLs like http://localhost/drupal7/#overlay=admin/config/modules if they only work when a certain module is enabled. This is a general issue, though, and perhaps a problem for core to solve either way (using fragments for JavaScript like this is getting very common - see, for example, Gmail). I think it is not hard for core to automatically redirect URLs like http://localhost/drupal7/#overlay=admin/config/modules to http://localhost/drupal7/admin/config/modules in the case where the overlay module is not enabled. That redirect won't work if JavaScript is disabled, though, which I guess would cause problems if this stuff is ever getting indexed by search engines - however, these aren't the types of pages that tend to be.

Also, ideally we would not special-case the overlay here; there would be a more general fragment name (something like #display rather than #overlay) that any module could use, and some kind of method for modules to tell Drupal that they want to actually use it - the overlay module being just one example. If no module claims it, Drupal would redirect to the canonical URL.

alex ua’s picture

I'm just subscribing here- the answer seems obvious to me: it's a terrible idea to have two different types of URLs for most admin functions (I'm assuming this will happen for contrib modules as well).

shunting’s picture

#1: Well, as long as there are URLs to be accessed from the page, people are going to be copying them and pasting them, whether in documentation or (more critically) in email, websites, and so on. It's important to realize that we can't control these URLs in the wild. So:

Do we really want two parallel systems of resource identifiers for all admin functions?

For example, suppose I want to use a URL to make RDF statements about my site. Which do I use? One? Both? Either? Use OWL to assert their identity?

shunting’s picture

Priority: Critical » Normal
Issue tags: -RDF, -Documentation, -DrupalWTF, -D7UX usability

#1: My point is not that "http://localhost/drupal7/#overlay=admin/config/modules" is an ugly URL, though it is.

My point is that when we have overlays turned off, there will be two completely different URL types for the same bundle of functionality, one with hash, one without (so not the same as alias, either).

(Updated for clarity.)

David_Rothstein’s picture

Right, this is not about ugly URLs - and I'm not sure what I wrote above that suggested it was :) ....

I don't actually think multiple URLs are a fundamental problem. Drupal already allows you to make URL aliases (which are true duplicates in functionality, as compared to the ones we're talking about here, which are not). The problem here is just that when the overlay is not available, the duplicate URLs do not display what we'd want them to.

Again, we ideally need a general way to fix this because you need this method to do any kind of real navigation using JavaScript. The jQuery BBQ plugin for handling these types of URLs is available to be loaded whenever it is needed (http://api.drupal.org/api/function/system_library/7). The question is how to use it in a general and efficient way. I don't have a good sense of how to do this at the moment, but I think it starts by looking at the Drupal.overlay.trigger() function and trying to generalize that.

casey’s picture

Patch in #668104: Make overlay respect other click handlers at least keeps all origional URLs in html source; users can easily copy them.

mcrittenden’s picture

Sub.

joachim’s picture

This is *really* going to hurt documentation and support.

I suggest upping this to critical.

shunting’s picture

Priority: Critical » Normal

You still have two parallel systems -- two URLs for addressing the same bundle of functionality, yes?

Does making the duplication more visible solve the problem?

For example, imagine we want to make RDF statements about admin functions. Which link should we use? One? Both? In the semantic web, semantics count...

shunting’s picture

Priority: Normal » Critical

#8 joachim

Since you suggest bumping this to critical, I will do so.

shunting’s picture

Priority: Normal » Critical

You're right on "ugly." I was reacting prematurely to "people passing around URLs like..." which suggested ugliness to me. Perhaps because these URLs are ugly, as you say.

shunting’s picture

Question, showing vast ignorance:

Why is the hash syntax needed in the first place? We have a powerful dispatching system; do we really need another layer for it? Could the real problem be using the admin links for overlay in the first place, instead of some parallel and less obtrusive implementation?

mrfelton’s picture

Issue tags: +DrupalWTF

I think that having two URLs for these pages is going to really confuse and probably anger some groups of people. If it doesn't get fixed I can see it being another DrupalWTF (adding the tag).

Isn't there some other (invisible) way that Overlay could decide if something should be shown in an overlay or not?

shunting’s picture

Issue tags: +RDF, +Documentation, +D7UX usability

Since this also impacts usability and RDF (possibly) I'm adding tags for those

mcrittenden’s picture

Priority: Normal » Critical
Issue tags: +RDF, +Documentation, +DrupalWTF, +D7UX usability

@shunting

Why is the hash syntax needed in the first place?

I believe the main reason was that it allowed for the browser's forward/back buttons to remain intact. So, you click a link in the toolbar and decide you didn't want that, you can just click back to make the overlay go away, whereas without the hash syntax, clicking back would take you all the way back to the previous page. It's also useful for navigating inside the overlay...such as if you click Configuration and Modules in the toolbar to open the overlay, then click Modules inside the overlay, and then decide you really wanted Configuration, you can just hit back.

So whatever this issue does, I think it's pretty important that it keeps the forward/back buttons working as expected.

mrfelton’s picture

Is there some Javascript trick that can be used to replace the address that is shown in the address bar once the page has loaded (I doubt it)? eg. replace http://localhost/drupal7/#overlay=admin%2Fconfig%2Fmodules with http://localhost/drupal7/admin/config/modules so that anyone copy/pasting the link gets the non overlay version, but forward/back still works as expected? Just a thought.

kiphaas7’s picture

Not really, not without a reload of the page. It cannot be done for security reasons.

mrfelton’s picture

as I thought.

arhak’s picture

I guess the following might throw some light to this issue:

suppose you have clean URLs enabled, but suddenly they stop working (upgraded the host, disabled mod_rewrite, migrated the site, whatever reason) then all URLs you have distributed (e-mails, other websites like: twitter/slashdot, etc) will stop working, since now they require a ?q= prefix that didn't previously existed

on the site note: also if you didn't previously disabled clean URL through the admin interface you'll have to go to the {variable} table and manually set clean_url to false (i.e. s:1:"0";) to get the site back

isn't the #overlay= prefix the same case just with inverted logic?

probably they should be a README.txt note stating that in this case an HTTP 301 should be returned for those URLs, even through RewriteRules, PHP code, Global Redirect, etc

Anonymous’s picture

This shouldn't affect RDF.

In the case of RDF a URI should not be dependent on the technology, so you should not use the JavaScript-dependent hash URI, only the system URI. The URI does not need to account for all URLs that are used to reach the resource, it just needs to be a unique and dereferencable identifier. The system URI (e.g. http://example.com/admin/config/modules) meets these two criteria.

As someone said above, this is similar to path aliasing. You can create as many aliases to the node as you want, but the system's unique identifier (node/x) will be used as the URI for that node.

catch’s picture

Priority: Critical » Normal

There should be a standard for linking to the non-overlay URL in documentation. #668104: Make overlay respect other click handlers fixes the rest of the issue. This isn't critical.

Anonymous’s picture

Status: Active » Closed (won't fix)

No further discussion for over 2 years, I'm going to close this one out.