This patch simply removes arg() calls where they aren't needed by this module.

Comments

neclimdul’s picture

StatusFileSize
new972 bytes

port of patch to 4.7.x-1.x-dev

kbahey’s picture

Status: Active » Needs work

Are 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?

neclimdul’s picture

Status: Needs work » Needs review

Not 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. :)

kbahey’s picture

Status: Needs review » Fixed

Yeah,

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

Anonymous’s picture

Status: Fixed » Closed (fixed)