unlink, and hook_menu
danielb - September 5, 2008 - 05:07
| Project: | Deadwood |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | solotandem |
| Status: | postponed |
Jump to:
Description
Great module, saved me heaps of time.
I noticed that it didn't do hook_menu() correctly, firstly it left the $may_cache stuff in there. Also it changed the 'access' array element to 'access arguments' instead of 'access callback', which took me a long time to figure out what had happened.
Then when I tried to 'uninstall' the module after disabling it, it tried to unlink and rm a bunch of stuff which just causes a lot of errors because I don't think our webserver has permission to do stuff like that. Just thought you'd like to know in case there is a way to handle it differently.
The module I upgraded is the version 5 of http://www.drupal.org/project/autocomplete_node_finder

#1
also it didn't turn '#validate' into '#element_validate', but it did properly change the format of how the validate function was passed in :P
#2
Glad to hear Deadwood saved you time. That's the goal.
I have been aware of the $may_cache issue all along. (Deadwood adds a comment to the file indicating user intervention is needed for these changes.)
Your module has 'access' => user_access('administer autocomplete node finder'). Deadwood turns this into 'access arguments' => array('administer autocomplete node finder'). To my knowledge, this is correct. The 'access callback' parameter would apply if you had a custom access function (other than user_access). If you can point to documentation that says otherwise, let me know.
I have also been aware of the '#element_validate' issue. The '#element_validate' issue is a parsing issue. With a regular expression, it is not at all easy (or feasible) to determine the expression is part of an element and not the form. If you have any suggestions on this, let me know.
Regarding the web server not having privileges, how did you get Deadwood to install in the first place? Installation required write access to the files directory to create the subdirectories. It would seem the server should then be able to delete the directories? I would also assume you are using Deadwood on a development box that you have sufficient privileges on.