Events with series registration show cached availability value on eventinstance page

Created on 10 January 2023, over 1 year ago
Updated 3 February 2023, over 1 year ago

Problem/Motivation

We have the registration availability value showing on event instance page. For events that are set to series registration, when someone registers for an event and then visits the event instance page, the registration availability does not show the updated value but shows a cached value instead. This value should be updated immediately.

Steps to reproduce

Create an event with series registration enabled. Turn on all caching. Have the registration availability visible on the event instance page somewhere. I am calling it inside a twig template where the registration_availability variable is loaded via hook_preprocess_eventinstance:

$registrationService = \Drupal::service('recurring_events_registration.creation_service');
$variables['registration_availability'] = $registrationService->retrieveAvailability();

As an anonymous visitor, register for an eventinstance for the series you created. Visit the eventinstance page and notice that the availability output is the old, cached value.

As admin, clear caches.

As anonymous visitor, reload the eventinstance page and see the updated, correct availability value output.

Proposed resolution

In RegistrantForm::save, the cache tags for eventseries are invalidated for events with series registration. I believe eventinstance tags should be invalidated here as well. See patch below.

πŸ› Bug report
Status

Fixed

Version

2.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

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.69.0 2024