Problem/Motivation
PHP Fatal error: Uncaught Error: Class "Drupal\fullcalendar_view\Controller\CalendarEventController" not found in /var/www/html/web/modules/contrib/smart_date/src/Controller/FullCalendarController.php:18
In Drupal 11.x, the new attribute-based hook system proactively reflects on all PHP classes in a module's src/ directory during container build to discover #[Hook] attributes. This triggers autoloading of FullCalendarController, which extends CalendarEventController from fullcalendar_view. If fullcalendar_view is not installed, PHP throws a fatal error at bootstrap — even if the module's RouteSubscriber correctly guards the route and the controller would never actually be invoked.
Prior to Drupal 11.x this was harmless because PHP only loaded the class lazily, when the route was accessed.
Steps to reproduce
Install the module with core 11.4, witness the error.
Proposed resolution
Add a class_exists guard before the class definition in FullCalendarController.php that returns early from the file if fullcalendar_view's base class is not available. This prevents the fatal at container build time while leaving the existing behavior intact when fullcalendar_view is installed.
Remaining tasks
User interface changes
API changes
Data model changes
Issue fork smart_date-3591333
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mandclu commentedThis class is deprecated anyway, so this may be the incentive to roll the 11.4 compatibility fixes into a new major version of Smart Date, and just drop this class entirely.
Comment #5
mandclu commentedComment #6
mandclu commentedWith a stable release of Drupal core 11.4 now available, I was able to install Smart 4.2.8 by itself as well as within the Events recipe. Both completed without error. If there are additional steps needed to reproduce the fatal error, please provide the necessary steps and reopen the issue.