rsvp-system/rsvp-system-module

Core Drupal module for the RSVP System. Implements hooks that must live in a module (not a theme), including Views query filters for the calendar event view.

Maintainers

Package info

gitlab.com/rsvp-system/rsvp-system-module

Issues

Type:drupal-module

pkg:composer/rsvp-system/rsvp-system-module

Statistics

Installs: 54

Dependents: 1

Suggesters: 0

Stars: 0

1.0.61 2026-03-24 14:32 UTC

README

A Drupal module implementing the server-side hooks for the RSVP System — a recipe-based platform for building calendar and reservation sites with Drupal.

Drupal: ^10.3 || ^11.0 PHP: ^8.3 Part of: RSVP System

Why This Module Exists

Drupal's ModuleHandler::invokeAll() does not invoke theme implementations of hooks like hook_views_query_alter or hook_views_post_render. Any hook that must run as part of the server-side request lifecycle — rather than at theme render time — requires a dedicated module. This module provides those hooks for the RSVP System.

What It Does

Calendar Views Filtering

hook_views_query_alter injects month-range and community filters into two Views:

  • rsvp_event_calendar — Filters one-off rsvp_event nodes (Smart Date Unix timestamps) to the current calendar month and community. Applies the ADR-0015 owner-OR-audience community model.

  • rsvp_recurring_events_block — Filters eventinstance entities (ISO datetime strings) to the current month. Community filtering JOINs through the parent EventSeries, because drupal/field_inheritance propagates community fields at display time only and does not write them to the EventInstance database tables.

FullCalendar Month Lock

hook_views_pre_render sets FullCalendar's initialDate and validRange options dynamically so the calendar renders at the correct month for the current page, rather than defaulting to today's date.

Unified Calendar Display — Recurring Events Injection

hook_views_post_render injects EventInstance events from drupal/recurring_events into the same FullCalendar grid as rsvp_event nodes, without a SQL UNION. The FullCalendar style plugin stores its event data in drupalSettings inside the render array's #rows key. This hook appends a second event source array in PHP before the render array reaches the browser. FullCalendar.js merges all sources onto the same grid.

EventInstances receive the fc-recurring-event CSS class for visual distinction. Community filtering uses the same EventSeries JOIN pattern as the query alter hook.

Pathauto Support for Recurring Events Entities

hook_entity_base_field_info adds the path base field to both eventseries and eventinstance entity types. drupal/recurring_events:^3.0 does not implement path aliasing natively; this hook is what enables Pathauto to generate URL aliases for recurring events entities.

Submodule: rsvp_reservation_widget

An AJAX cascading form widget for the rsvp_reservation node form.

Replaces the raw entity reference widgets for community and resource fields with a two-step UX: a community selector (defaulting to the user's primary community) followed by a resource selector filtered to that community. Resource options come from the rsvp_resources_by_community View. Values are written back to the underlying fields via #element_validate.

Enable separately:

vendor/bin/drush en rsvp_reservation_widget

Installation

This module is included automatically when a site requires the RSVP System requirements metapackage:

composer require rsvp-system/rsvp-requirements
vendor/bin/drush en rsvp_system_module

Or install directly:

composer require rsvp-system/rsvp-system-module
vendor/bin/drush en rsvp_system_module

No additional configuration is required. Hooks fire automatically when the target Views (rsvp_event_calendar, rsvp_recurring_events_block) are present.

Dependencies

This module depends on:

  • drupal:views
  • drupal:node

The rsvp_reservation_widget submodule additionally requires:

  • drupal:taxonomy

Contrib module dependencies (drupal/recurring_events, drupal/field_inheritance, drupal/fullcalendar, drupal/smart_date, drupal/pathauto) are pulled in via the rsvp-system/rsvp-requirements metapackage.

Related Packages

PackagePurpose
rsvp-system/rsvp-requirementsComposer metapackage — all contrib dependencies + this module
rsvp-system/rsvp-recipesDrupal recipes — config for calendar, events, reservations, communities
rsvp-system/rsvp-system-themeTailwind-based frontend theme

License

GPL-2.0-or-later. See LICENSE.