- Issue created by @joaopauloc.dev
- Merge request !128Adding validation on EventSeriesForm:buildForm to check if the entity exists load when editing. → (Open) created by joaopauloc.dev
I had this issue when I tried to use this module with the conditional_fields module.
I tried to add some conditional fields to the eventseries entity but failed.
The following error message appears.
The website encountered an unexpected error. Try again later.
AssertionError: Cannot load the "eventseries" entity with NULL ID. in assert() (line 261 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
Validate the entity before loading it.
As the module use the following logic $editing = ($form_state->getBuildInfo()['form_id'] == 'eventseries_' . $entity->bundle() . '_edit_form');
to check if the form operation is editing. We could also update line 233 of the EventSeriesForm file to check if the entity exists.
if ($editing && $entity->id()) {
$original = $this->storage->loadUnchanged($entity->id());
if ($this->step === 1) {
..........
Active
2.0
Recurring Events (Main module)