Allow validation to happen on field types that extend the telephone field type

Created on 9 December 2019, about 5 years ago
Updated 13 March 2023, almost 2 years ago

Problem/Motivation

Currently the module only affects telephone field types. In our current project, we had to extend the field type to add some extra properties to it, but this prevents this module from working with the new field type.

Proposed resolution

Stop checking the field type directly, and check if the field is an instance of the telephone field type, or of any type that subclasses it.

Remaining tasks

- Review
- Commit

User interface changes

- None

API changes

- None

Data model changes

- None

✨ Feature request
Status

RTBC

Version

2.0

Component

Code

Created by

πŸ‡ͺπŸ‡ΈSpain marcoscano Barcelona, Spain

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    Nice work @marcoscano! Would be great to have tests, but RTBC!

  • πŸ‡ΊπŸ‡ΈUnited States tea.time

    +1 for this! We're using the Phone Label β†’ module and this patch allows the validator to apply to instances of the phone label field with no additional code.

    In this case, the error message display is a bit awkward because it appears below both the phone number input and the label input, as well as a third time below the parent form element, but that's a different issue. :)

  • Status changed to Needs work 3 days ago
  • πŸ‡³πŸ‡΄Norway zaporylie

    This is a great addition and I am all for it. We need a simple test coverage to make sure no regressions are added in the future.

Production build 0.71.5 2024