This project is not covered by Drupal’s security advisory policy.

Adds a new read-only Unique Code type to Drupal Fields. This field can be assigned to every entity.

How does it work?

This field will be pre-filled with a randomly generated code based on the settings provided by the User.

It will automatically perform a check to ensure that the code is unique in the field parent entity.
The user can choose between these types of code:

  • Alphanumeric
  • Numbers only
  • Letters only

Dependencies

Install

  1. Via Composer

    composer require drupal/unique_code_field

    Composer will download the module along with its required external libraries

  2. Via Drupal

    Simply copy/paste the link of this package inside the install from url field or download it in you modules directory.

Note: If you are not using Composer, you can manage external libraries with Ludwig

Usage

Just add a new field to your entity\content and choose Unique Code from the Field Type dropdown. Setting the options should be a trivial task, you just have to choose the code length and type (please refer to code types listed above) and your field should be ready to work.

Project information

Releases