To Reproduce:

  1. Turn clean URLs off AND disable mod_rewrite. mod_rewrite must be off, since D7 allows and uses clean urls even if they are disabled.
  2. Go to the overlay dashboard.
    http://localhost/drupal_cvs/#overlay=%3Fq%3Dadmin
  3. If you click "edit" on a piece of content in the "Recent content" block, you are taken to the edit form:
    http://localhost/drupal_cvs/?q=node%2F1%2Fedit&destination=%23overlay%3Dadmin
  4. If you submit the form, you end up back at:
    http://localhost/drupal_cvs/#overlay=admin
    This makes the overlay attempt to load http://localhost/drupal_cvs/admin, which results in a 404 error.

It also occurs if, instead of pressing submit, you press the "Add to Default Shortcuts" plus symbol next to the title.

It is pretty clear by comparing the first and last url that the "q=" is getting lost along the way.

The cause seems to be that the click handler in overlay-parent.js doesn't take clean URLs into account when it is rewriting the overlay links.

This patch adds a JS variable for clean URLs and adds a URL encoded "?q=" before the overlay destination in the redirect, so that the proper redirect is formed. Is there a Drupal standard way to check clean URLs in JS?

Thoughts?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

loganfsmyth’s picture

FileSize
922 bytes

Here is the patch.

loganfsmyth’s picture

Status: Needs review » Fixed

I can't reproduce this anymore, so I think that it was fixed at some point. My sample case definitely doesn't work now since editing a node takes you out of the overlay entirely.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

andrea.paiola’s picture

Priority: Normal » Critical
Issue tags: +404, +overlay

mod_rewrite turned off

New dev install, modify an article redirect to /#overlay=admin/content then redirect to /admin/content generating 404 error.

David_Rothstein’s picture

Priority: Critical » Normal
Status: Closed (fixed) » Needs review

It seems like some parts of the overlay don't work correctly with clean URLs turned off yet. For example, with clean URLs turned off, when you add a shortcut via the "+" icon next to the page title the shortcut does not immediately appear in the toolbar.

A lot of this (particularly in the case where you have turned mod_rewrite off on a server where it used to be on) may be a duplicate of #13594: Fix 404 handling without clean URLs, though - i.e., not specific to the overlay.

mightyiam’s picture

I'm experiencing this:
http://drupal.org/node/852190

Perhaps it is a duplicate of this one?

There is an easy way to test this issue - by editing a user.

Blessings,
Shahar

sun’s picture

marco71’s picture

I think I have this problem with a 7.2 manual install. But you guys are talking 8.0 right?
Just downloaded 7.2 and experience not being able to navigate to the admin/config page.
(apache2.2.19/ PHP 5.2.17)

I end up with a URL like so

http://localhost/?q=node#overlay=%3Fq%3Dadmin/config

Also editing this does not get me to the page. I get a blank screen.
Might this be related?

Regards Marco71

I now imported the non fuctioning site into a acquia-stack-installer set up and now thing work.
(apache2.2.17/ PHP 5.2.17)

I tried many of the things I read about apche config for Drupal mod rewrite and all that but that wouldn't work.... Still on this.

marco71’s picture

FileSize
454.12 KB

Added a screenshot

loganfsmyth’s picture

Here is a rerolled patch that does the same thing as the previous patch.

This is still happening, but it isn't quite so bad now because it does not error our at step 4 anymore.
Now it redirects /#overlay=admin to /admin, which now works because of the changes to how drupal processes clean urls. That behavior is still wrong though, since it should go back to the overlay.

@marco71 Those errors you posted in #9 don't look related to this unfortunately. That looks like it would be caused by one of your modules having a non-existent access callback.
The link to admin/config that you posted works on my D7 copy, so perhaps you have something configured strangely?

Status: Needs review » Needs work

The last submitted patch, d7-overlay-404-789920-10.patch, failed testing.

loganfsmyth’s picture

Oops, forgot to make the patch have the right base directory.

lyricnz’s picture

Status: Needs review » Needs work
WilliamB’s picture

Sorry, is there any patch for 7.2 for this issue?

WilliamB’s picture

2nd bug that is critical for 7.2 and that lacks backport to 7.2 ...
Is there any chance someone could post their fix, because as it is it redirect me everytime after editing taxonomy and nodes to the error not found page.

lyricnz’s picture

@WilliamB: either fix your clean urls, or turn off overlay module.
http://drupal.org/getting-started/clean-urls
Problem is not unique to 7.2 - it's been around a while. Chances are your upgrade broke clean urls (.htaccess file?), which made this bug apparent.

WilliamB’s picture

Thank you, found out that the problem was related to apache config.
Sorry about that.

David_Rothstein’s picture

Status: Needs work » Needs review

Looks like this should be needs review for the patch in #12 (I think?).

commander_keen’s picture

Status: Needs work » Needs review

Running fresh Drupal 7.1 on IIS6 this error is still present. (clean URLs cannot be used on IIS)

It redirects from /#overlay=%3Fq%3Dadmin%252Fpeople to /admin/people and throws a 404 not found.

The patch from loganfsmyth works, the problem is fixed afterwards. Only the line-numbers are already outdated. Please apply this fix to a release!

xgougeon’s picture

Also running fresh D7...
Can't edit taxonomy terms !!!! -> page not found when I click "Save"... Great.
Is there a definitive solutions ???

webbermusic’s picture

I found a solution that works for me, maybe for others too???

I have two test sites on my laptop, one for commerce and one for ubercart. The ubercart taxonomy module would not update, the commerce one would update.
So I looked in admin/modules/list and compared the two.

Adding chaos tools, rules, and views modules seems to have fixed it. If not than something else did, in any case I can now update modules.

Caveat - I'm a complete beginner at this and don't know what I'm doing so don't be surprised if it doesn't work for others but I suspect that if a backup is done first (probably files and dbase) then not too much damage can be done by adding modules.

Hope this helps.

webbermusic’s picture

The plot thickens:

It happened again, couldn't save updates. Turned off (disabled) taxonomy manager and updates can be saved again.

Will it last?

no

fkelly12054@gmail.com’s picture

Version: 8.x-dev » 7.17

New local install of 7.17. Being sent to admin/people, thus generating a 404 upon saving a user change. Reading this thread, turned off overlay module. Problem disappeared.

Note: user change was completed, destination AFTER the change was incorrect.

David_Rothstein’s picture

Version: 7.17 » 7.x-dev

I think the changes to clean URLs in Drupal 8 do mean this is a Drupal 7 bug only now (at least that seems to be the case based on some quick testing).

In general, please check that before changing the version away from 8.x, though... thanks :)

mgifford’s picture

12: d7-overlay-404-789920-12.patch queued for re-testing.