Registrant created datetime not editable or available as form element

Created on 30 December 2024, 5 months ago

Problem/Motivation

The Registrant entity does not have its created datetime available for the entity form. Presumably, this was done on purpose in the past.

Our use case is a client also takes offline registrations. They would like to be able to manually set the created date when adding these offline registrations into the website events registration system. For example, they collect registrations on the 4th of a month but can't add them to the website until the 5th. They would like to be able to set the date of these registrations as the 4th. This will matter in terms of waitlist order.

Steps to reproduce

Go to a form for creating or editing a Registrant. The option for editing "Authored on" information is not available (as seen on node-editing forms, for example).

Proposed resolution

Update the base field definition for "created" to:

    $fields['created'] = BaseFieldDefinition::create('created')
      ->setLabel(t('Created'))
      ->setDescription(t('The time that the entity was created.'))
      ->setRevisionable(TRUE)
      ->setDisplayOptions('view', [
        'label' => 'hidden',
        'type' => 'timestamp',
        'weight' => 0,
      ])
      ->setDisplayOptions('form', [
        'type' => 'datetime_timestamp',
        'weight' => 10,
      ])
      ->setDisplayConfigurable('form', TRUE);      
Feature request
Status

Active

Version

3.0

Component

Recurring Events Registration (Submodule)

Created by

🇨🇦Canada endless_wander

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

Comments & Activities

Production build 0.71.5 2024