Closed (fixed)
Project:
Flag content
Version:
5.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Feb 2007 at 23:56 UTC
Updated:
5 Mar 2007 at 02:18 UTC
Jump to comment: Most recent file
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