In #260708: Number component (Numeric field), Webform added support for a new "number" component. We should write the integration for Form Builder to match. We actually already even have a number.png image in the project that we can use for the icon.

CommentFileSizeAuthor
#1 form_builder_number_component.patch22.15 KBquicksketch

Comments

quicksketch’s picture

StatusFileSize
new22.15 KB

This patch adds support for the number component and applies to both D6 and D7. I could have copied the existing approach that we have for components to support the Number component as well, but all that copy/pasting was becoming unsustainable. Considering the number component had a record 8 custom properties, that meant adding 8 new functions that did nothing but call a single function with different parameters.

So I put in some effort to make it so that components could be supported in a more generic fashion. Instead of copy/pasting huge chunks of code for every component, this patch provides a new, alternative approach for components that allows them to merely set a "form_builder_map" to describe how FormAPI properties are mapped to the existing Webform configuration forms. After this patch is committed, we should be able to significantly reduce our code in form_builder_webform.components.inc by utilizing the new format.

quicksketch’s picture

Status: Active » Fixed

Committed to both branches.

Status: Fixed » Closed (fixed)

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