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.
Currently all our admin pages are just plopped right in the middle of flag.module. However, since these functions are rarely needed, it'd be much more efficient to split them out into a flag.admin.inc file and pull that file in when necessary via hook_menu().
This request is on behalf of the d.o administrators, who would like Flag to be more efficient for use on drupal.org.
Comment | File | Size | Author |
---|---|---|---|
#13 | flag-DRUPAL-6.cleanup.patch | 12.19 KB | sun |
#9 | flag_admin_split5.patch | 41.37 KB | quicksketch |
#5 | flag-DRUPAL-6--1.admin_.patch | 41.07 KB | sun |
#3 | flag_admin_split6.patch | 37.65 KB | quicksketch |
#3 | flag_admin_split5.patch | 39.48 KB | quicksketch |
Comments
Comment #1
dww+1 subscribe
;) Sorry, couldn't help myself.
Comment #2
webchickNote that killes also said that he'd prefer that field.actions.inc and field.tokens.inc also be included only when necessary.
Comment #3
quicksketchHere are patches for splitting out the Admin pages for both Drupal 5 and Drupal 6. The D6 version was a breeze, D5 was easy too, but I'm not sure if the method I used is appropriate for including when necessary (oh... Drupal 5....). If someone could confirm this is an acceptable approach and test it out I think we're good to go on these.
Comment #4
quicksketchflag.actions.inc currently is only 25 lines so I don't think it's doing much harm. But wtf is it just sitting in the root directory of the module? I'll make a separate issue for that. :P
#404096: Move flag.actions.inc into /includes
This one is ready for review though.
Comment #5
sunFirst part.
Didn't check how actions.inc and tokens.inc are included.
Comment #6
sunHeh. Oops. ;)
My patch contains some additional clean-up, not just pure moval of functions. However, I can also redo that afterwards.
Yes, that works for D5. However,
would be faster.
Comment #7
dww@sun: Thanks for helping, however, yes, PLEASE avoid the "other cleanup" urge in patches like this. ;) Also, please read the battle plans and work on patches that no one else is working on. ;)
@quicksketch: I still think using hook_init() like that in the D5 backport is a hack. I'd rather see you use a pass-through menu callback in cases like this, but do whatever you want to do. However, I think your D6 patch is wrong. In hook_menu(), I believe you want to specify:
Specifying just "file" with a relative path seems wonky. Maybe that works, but it seems better to be explicit.
Comment #8
quicksketchI never specify "file path", neither does core. I don't think it's necessary. http://api.drupal.org/api/function/node_menu/6
Comment #9
quicksketchYeah, the D5 version was indeed super wonky. Here's a reroll that uses a pass-through function and makes me feel much better about the approach.
Comment #10
dww@quicksketch: Cool, looks good to me. I haven't tested but yeah, that looks a lot better. And cool, duly noted on 'file path' -- I just have an aversion to implicit relative paths from circa 1990. ;)
Comment #11
Pasquallethe 'file path' is not required
http://drupal.org/node/146172
Comment #12
quicksketchCommitted #3 for D6 and #9 for D5. Thanks for the help everyone. :)
Comment #13
sunIf you want to have 'em, here's a patch containing the clean-ups only.
Comment #14
Pasquallemodule_invoke is meant to be used to invoke hooks, using module_invoke for anything else is confusing..
http://lists.drupal.org/pipermail/development/2008-June/thread.html#30235
Comment #15
webchickHow about start a new issue to discuss a general clean-up (the patch overall looks good) since this issue was originally well-scoped and is fixed.