Problem/Motivation
The module provides a field type and widget, a tckk Form API element and the tckk_field.validator service, but no Webform element plugin. Webform only lists and fully supports elements that have a WebformElement plugin.
Using '#type': tckk in webform YAML falls back to Webform's hidden "Generic element" plugin (webform_element):
- the element is not available in the form builder UI and its properties cannot be edited there;
- conditional logic (
#states), submission display, export and Webform Views integration are not guaranteed.
A plain textfield cannot be wired to the validator either, because Webform ignores #element_validate in element YAML for security reasons (WebformElementHelper ignored properties).
Proposed resolution
- Add a
tckk_field_webformsubmodule (dependencies:tckk_field,webform:webform) so the main module keeps working without Webform. - Provide a
WebformElementplugintckkextendingTextBase, rendering the existingtckkelement and validating withtckk_field.validator. - Defaults:
#maxlength11,inputmode="numeric", a translatable error message. - Tests: a functional test submitting a webform with valid and invalid numbers, including
#statesvisibility/required.
Remaining tasks
- Fix the validator bugs first: #[bug issue number]
- Implement the submodule and plugin
- Tests
- README update
User interface changes
A new "T.C. Kimlik No" element appears in the Webform element list when the submodule is enabled.
API changes
None.
Data model changes
None. Webform stores the value as a string in webform_submission_data.
Issue fork tckk_field-3630849
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #4
orkutmuratyilmaz