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

Created on 9 December 2019, almost 5 years ago
Updated 16 June 2023, over 1 year 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. :)

Production build 0.71.5 2024