Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Module should be add a redirect from old alias to 'node/nid' when remove alias. Now when I type old URL I get an 404 error.
Comment | File | Size | Author |
---|---|---|---|
#6 | path_redirect-deleted_alias-v02.patch | 5.08 KB | kubala.webdesign |
#2 | path_redirect-deleted_alias.patch | 1017 bytes | kubala.webdesign |
Comments
Comment #1
kubala.webdesign CreditAttribution: kubala.webdesign commentedComment #2
kubala.webdesign CreditAttribution: kubala.webdesign commentedthat patch solved problem
/Edit: orphaned redirects after delete node, infinity loops :/ I'll work tomorrow on that..
Comment #3
kubala.webdesign CreditAttribution: kubala.webdesign commentedComment #4
John Pitcairn CreditAttribution: John Pitcairn commentedsubscribe
Comment #5
cmseasy CreditAttribution: cmseasy commentedMaybe "rules" can help here? See #13 at http://drupal.org/node/808028.
Comment #6
kubala.webdesign CreditAttribution: kubala.webdesign commentedpatch for redirecting from old alias to node/_nid_ after alias having been removed in attachment.
It's also solve bug described in #648598: Duplicate entry 'node-' for key 2 query: INSERT INTO path_redirect, by checking nid in nodeapi and looking for duplicates in path_redirect_check_alias_changed and update existing row when it's recommended.
I tested it, everything is OK, but it's small bug (i think in path module) with apostrophes. I also add few stripslashes() and addslashes() function to prevent SQL Injection (let's imagine situation where redirect = "something' or redirect = 'another_redirect", and we try delete node with that alias..).
I also replace path_redirect_delete_multiple() by my own function to make orphaned redirects impossible.
PLEASE REVIEW THIS.
Sorry for broken english, i hope you're understand me ;)
Comment #7
kubala.webdesign CreditAttribution: kubala.webdesign commentedComment #8
mikeytown2 CreditAttribution: mikeytown2 commentedsubscribe; plan to test soon.