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_webform submodule (dependencies: tckk_field, webform:webform) so the main module keeps working without Webform.
  • Provide a WebformElement plugin tckk extending TextBase, rendering the existing tckk element and validating with tckk_field.validator.
  • Defaults: #maxlength 11, inputmode="numeric", a translatable error message.
  • Tests: a functional test submitting a webform with valid and invalid numbers, including #states visibility/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

Command icon 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

orkutmuratyilmaz created an issue. See original summary.

  • 515e66ac committed on 1.0.x
    Issue #3630849: Add a Webform element for T.C. Kimlik No
    
    - Add the...
orkutmuratyilmaz’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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