This patch simply removes arg() calls where they aren't needed by this module.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flag_content_remove_arg_0.patch | 972 bytes | neclimdul |
| flag_content_remove_arg.patch | 960 bytes | neclimdul |
This patch simply removes arg() calls where they aren't needed by this module.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | flag_content_remove_arg_0.patch | 972 bytes | neclimdul |
| flag_content_remove_arg.patch | 960 bytes | neclimdul |
Comments
Comment #1
neclimdulport of patch to 4.7.x-1.x-dev
Comment #2
kbahey commentedAre you sure you are not missing something?
How does the $nid in the function argument get there?
Maybe arg() should be in the _menu() hook, and a callback argument passes it?
Comment #3
neclimdulNot true, since their menu callbacks their passed these arguments automatically. see http://api.drupal.org/api/4.7/function/arg and http://api.drupal.org/api/4.7/function/page_example_menu function page_example_foo_baz and also just for clarity, right at the end of menu_execute_active_handler you can see the arguments from q= being merged with and other arguments and being passed to the callback function.
This makes your functions more usable, maintainable and saves a function call for each argument. :)
Comment #4
kbahey commentedYeah,
After replying to you I checked menu.inc and found that by default the arguments from q= are put in the $arguments array.
I guess this behaviour should be documented more clearly.
Committed to HEAD, 4.7 and 5.x.
Thanks
Comment #5
(not verified) commented