Unexpected error when adding reference field into event instance.

Created on 24 October 2024, 3 months ago

Problem/Motivation

Error when I'm trying to add a new field in the event instance entity.
Using Drupal 10.3.6 and also in an empty Drupal installation 10.1.8

Steps to reproduce

  1. Install the recurring_events module 2.0.2
  2. Go to /admin/structure/events/instance/types/eventinstance_type/default/edit/fields
  3. Add a new field referenced field, like taxonomy or content.
  4. In reference type checkboxes check one of the options.

You should see an ajax error
Also, if you go recent log log messages: an message like: Error: Call to a member function hasTranslation() on null in Drupal\recurring_events\Entity\EventInstance->getEventSeries() (line 368 of /var/www/web/modules/contrib/recurring_events/src/Entity/EventInstance.php). should appear.

You can see the error in the image below:

Proposed resolution

In the following computed fields:

  • WaitlistCount
  • AvailabilityCount
  • RegistrationCount

Add the field_ui.field_add_eventinstance route as the excluded route in the $excluded_routes variable.
Like:

$excluded_routes = [
      'entity.eventseries.add_instance_form',
      'field_ui.field_add_eventinstance',
    ];

Remaining tasks

🐛 Bug report
Status

Active

Version

2.0

Component

Recurring Events (Main module)

Created by

🇧🇷Brazil joaopauloc.dev

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

Merge Requests

Comments & Activities

Production build 0.71.5 2024