This module adds a new field type to Drupal with optional pattern validation to match Personal Identification Code (PIC) format. This module does not check if the given PIC is a real or fake, but considers only the format.

Currently supported format checks include:

Adding more validators is a matter of providing constraint and the validator, see examples in the project Git repository.

Patches for the new constraints and validators are greatly appreciated!

Installation

  1. Download the module, compser require drupal/personal_id.
  2. Enable Personal ID -module (personal_id).
  3. Add a field of type "Personal ID" to an entity - it is grouped with other Text fields. Save field settings.
  4. In the "[Field name] settings for [bundle name]" page select which "Personal ID validation" you wish to have.
  5. Note that ALL selected validators must pass for user to be able to submit value in the field.

Version information

Versions 8.x-1.0-beta2 and 2.0.0+ are in functionally identical. While 8.x-1.0-beta2 works for lower Drupal core versions (8.7 and earlier), the 2.0.0 will support only Drupal 8.8.0+ and Drupal 9.

Full release pending tests

Full release of this project is pending only tests #3129029: Add PHPUnit tests.

Supporting organizations: 

Project information

Releases