The first comment on https://api.drupal.org/api/drupal/modules%21system%21system.api.php/func... points out that the parameter should be passed by reference, which seems to be correct. But even if that's not correct, there's also no return in the example, so I think the documentation is misleading either way.

I believe the documentation needs "$commands" changed to "&$commands". I'll leave this rare one-character core patch opportunity for someone else to enjoy.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jhodgdon’s picture

Title: hook_ajax_render_alter() documentation is misleading » hook_ajax_render_alter() is missing & in function signature
Issue tags: +Novice

Good catch! Yes, it should be passed by reference, as in all other _alter() hooks.

This is a 7.x problem only by the way; the 8.x docs have the &.

This one-character patch opportunity is great for a Novice contributor...

asrob’s picture

Status: Active » Needs review
FileSize
514 bytes

I attached a patch, thanks for the opportunity!

jhodgdon’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, that is what we needed! I'll get it committed soon.

jhodgdon’s picture

Status: Reviewed & tested by the community » Fixed

Thanks again! Committed to 7.x.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.