Validity Field

Categories

Component ID

1515940

Component name

Validity Field

Component type

module

Maintenance status

Development status

Component security advisory coverage

not-covered

Component created

Component changed

Component body

Validity Field creates a date field that can be attached to any fieldable entity with added functionality.

Functionality

Token Support

Validity Field uses Date tokens, for each validity field added, a token for start and end date is available.

Panels Support

Validity Field adds a new access control "Validity Check", which can be used in Visibility Rules of a Panel Content: for example, only show this content when the context is valid, or show this content (i.e. a warning) if the context is valid and expires in two weeks.

References Support

Validity Field adds new functionality for the entity reference module: if checked, it will check the data validity for the referenced entity and suppress its load if the referenced entity is not valid for today's date.
The setting is in the Widget display setting for the validity field.

Rules Support

Validity Fields adds two new events and one new condition:

  • Event "Entity becomes valid": triggers when an entity's validity start date becomes current
  • Event "Entity stops being valid": triggers when an entity's validity end date becomes current
  • Condition "Entity is valid today": checks if at least one validity field value is valid for today.

The events rely on the cron process and will only trigger with each cron run, so if cron runs every hour, it can be almost an hour after a entity should trigger that it actually triggers.

Rationale

I did find myself repeating the same steps every time I setup a site. This modules brings together some functionality for making an entity time dependent and shortcuts development time. It adds handy features that comes from knowing that a specific field of a specific type exists.

Installation

  1. Download and enable the module
  2. Navigate to admin/config/user-interface/validity to create validity fields and attach them to any entity.

Dependencies