Closed (duplicate)
Project:
Save Redirect On Delete
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
14 Dec 2013 at 06:56 UTC
Updated:
8 Apr 2014 at 13:25 UTC
Jump to comment: Most recent
Comments
Comment #1
gaurav.goyal commentedComment #2
gaurav.goyal commentedComment #3
michel_v commentedHi
I've tried to test your module, was unable to get it to work however, following the steps detailed in the readme file:
1. Created a page @ url /deleted
2. Set the Default Pattern After Delete to [site:url]/deleted
3. Created an alias for an existing node to /testthis
4. Deleted this node, having checked the alias worked.
5. /testthis alias now just goes to page not found, rather than [site:url]/deleted as per expected behaviour.
Also, pareview comes up with issues:
http://pareview.sh/pareview/httpgitdrupalorgsandboxgauravgoyal2155137git...
Thank you
Michel
Comment #4
@purushHi Gaurav. Goyal,
http://pareview.sh/pareview/httpgitdrupalorgsandboxgauravgoyal2155137git... is still showing a list of errors.
./save_redirect_on_delete.module: all functions should be prefixed with your module/theme name to avoid name clashes. See http://drupal.org/node/318#naming
Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
FILE: ...var/www/drupal-7-pareview/pareview_temp/save_redirect_on_delete.install
FILE: /var/www/drupal-7-pareview/pareview_temp/save_redirect_on_delete.module
Comment #5
@purushHi Gaurav. Goyal,
Upon manual review,
1 - I see the repeated code/same code for both hook_node_delete and hook_user_delete, My suggestion is to use the hook_entity_delete where Act on entities when deleted (i.e. Node, user, comment).
2 - Unsetting a persistent variable on hook_unistall, deleting the variable directly from the database are not recommended because code doesn't unsets the data from the $conf global variable see
You should use variable_del where it unset the data from $conf global variable.
Comment #6
tr commentedIf you are trying to get git access to publish your project, you need to post this issue in the Drupal.org Project applications queue at https://drupal.org/project/issues/projectapplications
Posting this here in your sandbox issue queue will not get your project published.
Comment #7
gaurav.goyal commented@all : Guys thank you very much for your valuable feedback's, and i apologize for replying late.
@michel_v : I repeated all the steps u mentioned, and this works for me as expected. Can u please give it a try once after re-installing.
@Purushothaman Chinnadurai :
1. The reason behind not using the hook_entity_delete function is because pathauto module uses hook_node_delete, hook_user_delete function to delete the url alias for the entity which is being deleted, and for my module to work i need the url alias before it gets deleted so i cant use hook_entity_delete.
2. Variables are created dynamically so i am not able to use variable_del(), another thing after deleting variables from db directly and cache clear, $conf array is rebuilt.
@ TR : thank you very much, I will create an issue over there.
@all : pareviews issue are fixed.
Thank you very much guys for supporting.
Comment #8
gaurav.goyal commentedComment #9
dahousecat commentedThis is my first review but hope I can provide some useful input.
I created an article called "delete me", deleted it and got redirected as expected.
I then tried to create a basic page called "delete me" however upon trying to save I got stuck in an endless redirection loop. I suspect you need to do some checking to see if the alias already exists when users create new content and alert them of the fact the alias already exists, maybe with an option to delete the old alias or edit the existing one that they are trying to create.
The redirection worked perfectly for all content types and taxonomy terms but I could not get it to work for any file types.
I created a basic page and attached a document (pdf), image (png), audio (mp3) and video (mp4). After deleting the page they were attached to I tried to visit the url to download these files but was not redirected anywhere.
The video, audio and document just displayed a Drupal page not found page, but the image just displayed a "Not Found" message not within a Drupal page (just blank apart from the message).
I've set the status to "Needs Work" as I think the endless redirection loop scenario needs looking at. (Let me know if this is not the right thing to do...)
Comment #10
dahousecat commentedComment #11
gaurav.goyal commentedduplicate of https://drupal.org/node/2205497