Register button doesn't appear when registration opens

Created on 15 October 2024, 6 months ago

Problem/Motivation

When an event has a scheduled registration period, the "Register" button should be shown on the event instance page as soon as the registration window opens. Similarly, when registration closes, the button should disappear automatically. Currently this doesn't happen, the button only appears / disappears after the cache is cleared.

Steps to reproduce

  1. Make sure the Internal Page Cache and / or the Internal Dynamic Page Cache module(s) are enabled.
  2. Create an event series that takes place in the future.
  3. Select the "Scheduled registration" option.
  4. Set the registration type to "Entire Series Registration" (optional, easiest way to test manually)
  5. Set the registration to open in 2 minutes.
  6. Save the event series.
  7. Visit the event instance page. Note that the "Register" button is not shown, because registration is not yet open.
  8. Wait 2 minutes.
  9. Reload the page.

Expected behavior: The button should appear.
Actual behavior: The button doesn't appear, only does so after clearing the cache.

Proposed resolution

Provide a cache context on the button that varies by the registration open / closed status.

Caveats

Due to limitations in the cache implementation in Drupal core (ref. 🐛 [pp-3] Bubbling of elements' max-age to the page's headers and the page cache Postponed ), this will not work for anonymous users unless a workaround is applied:

  • Disabling the Internal Page Cache module.
  • Installing the Cache Control Override module and setting a max-age of 0 on the page.
  • Disabling the page cache for the event instance page using custom code (e.g. a middleware)
🐛 Bug report
Status

Active

Version

2.0

Component

Recurring Events Registration (Submodule)

Created by

🇧🇬Bulgaria pfrenssen Sofia

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