I recently noticed that when you try to make a redirect for a bogus url (politics/fdjhafsdjjhdkfsalksdf) it returned this error. This is because Drupal will still load that url (as /politics) even though the path is not the correct path.

To fix this bug, I merely checked to ensure that the path provided by menu_get_item($element['#value']) was actually the value that was being passed.

Comments

kmonty’s picture

for the record, /politics was a view. This also happens at node/12/fjkdakjfdskjsdfakjsfda

dave reid’s picture

Status: Needs review » Needs work

Can you please re-upload your patch. I'm not sure if this would be fixed with #615008: "Forced" path redirect - override the existing path or alias.

kmonty’s picture

Status: Needs work » Needs review

Sorry, I don't know why that patch failed. This is a different issue than the force issue, although forcing would be a solution. The reason this is different is because I am attempting to redirect unregistered paths yet the module still denies me the privilege of redirecting them.

Additionally, this is an easy fix whereas the force option might not be available for some time.

kmonty’s picture

StatusFileSize
new807 bytes

Whoops

marcus0263’s picture

Thanks kmonty, this resolved my issue

http://drupal.org/node/647166

jim kirkpatrick’s picture

Status: Needs review » Reviewed & tested by the community

Works for me too, updating.

alrueden’s picture

This patch resolved my problem too (Path redirect would not recognize my number one 404, kept insisting it was valid already).

However, if you're using the most current update of this version, the relevant code is actually not in path_redirect.module. It's now in path_redirect.admin.inc. So you have to download path_redirect.admin.inc, change the one line, and re-upload it. Hopefully this will be fixed soon.

xsean’s picture

i tried to update the patch but i did not found function path_redirect_validate_source_f
or even the existing code in path_redirect.module and path_redirect.admin.inc

// Cannot create redirects for valid paths.
$menu_item = menu_get_item($element['#value']);
- if ($menu_item && $menu_item['page_callback'] != 'path_redirect_goto') {

i'm using version 6.x-1.0-beta5. is it only apply to certain version of path redirect?

chrisshattuck’s picture

I've created a version of this patch for 6.x-1.0-beta5 here: http://drupal.org/node/708484. Cheers!

mrfelton’s picture

StatusFileSize
new764 bytes

Updated patch applies to Drupal latest stable D6 version (none of the others applied for me)

yan’s picture

#10 worked for me.

dave reid’s picture

Is there a path in core (without having to install Views, etc) that can be tested to make sure this bug doesn't regress?

introfini’s picture

subscribing

kmonty’s picture

@David Reid

you can try to alias the path node/1/randomtextthatisneverused

jordanmagnuson’s picture

#4 worked for me. Thanks. I would love for this to be rolled.

Rainman’s picture

Good fix, another worked for me... big issue with ubercart catalog views

Thanks!

Mac Clemmens’s picture

Strongly recommend committing this patch. Have upgraded this module a few times and keep having to re-patch it.

vood002’s picture

I second committing this patch...I've experienced no bugs when using the patched module, and have had to repatch multiple times.

apshoemaker’s picture

Just wanted to confirm that #10 worked for me too. Please consider adding to next release.

dave reid’s picture

Status: Reviewed & tested by the community » Fixed

Thank you. Committed #10 to CVS.
http://drupal.org/cvs?commit=402790

Status: Fixed » Closed (fixed)

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