Webform's built-in components _webform_render_component() functions have a third, $filter, parameter which is not documented in webform_hooks.php

It looks like the available filters would be useful for other people implementing the webform API, in which case the parameter should be documented

Comments

firebus’s picture

Status: Active » Needs review
Issue tags: +Needs backport to D6
StatusFileSize
new1.42 KB

here's a patch with updated documentation

quicksketch’s picture

Thanks, I think it would probably be a good idea to be a bit more verbose about why you would have $filter = FALSE set also. The reason for this is because Form Builder module reads in the FormAPI array and makes it editable to the user. In this case you want the "raw" unfiltered description, title, and value set so that the user can modify it.

firebus’s picture

:) i actually didn't really understand what it was for - just noticed that it was used internally and jumped to the conclusion that it would probably be best practice for other users of the API :)

iirc there's a snippet of documentation where the render hook is invoked that tries to explain it - i'll copy, and expand to include mention of formbuilder if it's not already there.

thanks for your feedback!

firebus’s picture

i copied the documentation for this parameter from _webform_client_form_add_component and added a @see.

i think it's worth adding the redundancy since people are more likely to read the API docs than to dig through all of webform.module.

if you think it's worth being more explicit about how and when $filter is passed to the render function, i can be more verbose...

quicksketch’s picture

Status: Needs review » Fixed

Perfect. Thanks committed to 3.x branches.

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