Issue #3577429: Make Scheduler an optional progressive feature.
Makes Scheduler a progressive enhancement instead of a hard dependency. Built on current 1.0.x after #3584775 (closed) removed the bundle entity.
What changed
- Drops the
schedulerandscheduler_content_moderation_integrationdependencies fromai_context.info.yml; moved to composerrequire-devandsuggestso the modules install without them. - Removes the Scheduler components (
publish_on,unpublish_on,scheduler_settings) and theschedulermodule dependency from the baseconfig/installform display. - Adds an OOP
SchedulerHooksclass (#[Hook]) that seeds the bundleless Scheduler settings onhook_modules_installedand cleans them up onhook_modules_uninstalled(the procedural hook is a#[LegacyHook]shim superseded by the OOPmodules_installed, so the logic lives in the hook class).
Scheduling is off by default, Scheduler owns it
- The bundleless settings are seeded with
publish_enableandunpublish_enableset toFALSE, so scheduling is hidden by default even when Scheduler is installed (Drupal CMS 2.0 case). - Scheduler's own settings form for the entity type (
/admin/config/content/scheduler/ai_context_item) already manages both the enable flags and thepublish_on/unpublish_onform display components, so there is no competing toggle in AI Context. The AI Context general settings page links to that form. - Uninstalling Scheduler removes the bundleless settings and any orphaned date field components.
Also includes
- Fixes
ai_context_post_update_0002, which still referenced the pre-#3584775 view display id/path (ai_context_item.default.default) and fataledupdatedbon existing sites. Now points at the bundlelessai_context_item.ai_context_item.defaultdisplay. (Surfaced while verifying this MR; small enough to fix inline rather than open a separate issue.)
Tests and docs
- Adds
AiContextSchedulerOptionalTestcovering install-without-Scheduler, enable-seeds-disabled, and uninstall cleanup. - Updates the scheduling and README docs.
- Manually verified end to end in DDEV: install alone (no Scheduler), enable Scheduler (seeded disabled, fields hidden), enable via Scheduler's form (date fields appear), uninstall Scheduler (config + components removed).
Supersedes !92 (closed), which took the submodule route and was built on the now-removed ai_context_item_type bundle.
Closes #3577429
Edited by Matt Glaman