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
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | render_component_filter_documentation-1205852-4.patch | 1.53 KB | firebus |
| #1 | render_component_filter_documentation-1205852-1.patch | 1.42 KB | firebus |
Comments
Comment #1
firebus commentedhere's a patch with updated documentation
Comment #2
quicksketchThanks, 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.
Comment #3
firebus commented:) 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!
Comment #4
firebus commentedi 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...
Comment #5
quicksketchPerfect. Thanks committed to 3.x branches.