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.
OK, a simpler one, I hope. :-) This patch slices up the contact module into page handler files. contact.module itself is not quite 2/3 smaller when we're done, which is spiffy. :-)
Comment | File | Size | Author |
---|---|---|---|
#9 | contact_21.patch | 35.69 KB | pwolanin |
#1 | contact_20.patch | 35.64 KB | pwolanin |
contact_19.patch | 33.7 KB | Crell | |
Comments
Comment #1
pwolanin CreditAttribution: pwolanin commentedLooks ok overall, but I think we can make the menu part more elegant. See attached. This standardizes the use of a function contact_load(), and also has the benefit that if a non-existent cid is put into the URL for edit or delete, a "not found" page is returned.
note that both the add/edit and delete forms have been updated this way. The confirm form callback is much simplified as a result, and all hackish uses of arg() are abolished.
Comment #2
pwolanin CreditAttribution: pwolanin commentednote - since my patch changes hook_menu, either apply this patch before enabling the module, or enable/disable some other module to force a menu rebuild.
Comment #3
bennybobw CreditAttribution: bennybobw commentedI tested this patch. All the code style looks good, but I found the following bugs:
That's all for now.
Comment #4
pwolanin CreditAttribution: pwolanin commented@bennybobw did you force a menu rebuild? The behavior you describe should not occur, and do not occur for me.
Comment #5
bennybobw CreditAttribution: bennybobw commented@pwolanin confirmed on clean version of HEAD. I applied the patch before enabling the contact module. Then, just to be sure, I installed everything clean again, enabled the contact module, applied the patch, then enabled the Actions module. I am still getting everything reported above.
Comment #6
pwolanin CreditAttribution: pwolanin commentedhmm, that's odd if I go to a path like "admin/build/contact/edit/99" I get "Page not found".
if I got to "admin/build/contact/delete/99", I also get "Page not found".
Comment #7
pwolanin CreditAttribution: pwolanin commentedhowever this behavior:
I see also. But this is a problem with the menu system: http://drupal.org/node/155624
Comment #8
Crell CreditAttribution: Crell commentedI can duplicate what bennybobw is reporting using pwolanin's patch in #1. However, it looks like it's a case of this: http://drupal.org/node/155624, and is not directly related to this patch. For me, the navigation and title is broken before this patch anyway.
Setting back to CNR, and flagging the title issue as a dupe of the above.
Comment #9
pwolanin CreditAttribution: pwolanin commentedah, apparently found the problem - mysql vs mysqli returns FALSE vs. NULL if no data returns in db_fetch_array().
Attached patch adds one line to insure that contact_load returns FALSE if no data is loaded.
Comment #10
Dries CreditAttribution: Dries commentedTested and committed! :)
Comment #11
(not verified) CreditAttribution: commented