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 scheduler and scheduler_content_moderation_integration dependencies from ai_context.info.yml; moved to composer require-dev and suggest so the modules install without them.
  • Removes the Scheduler components (publish_on, unpublish_on, scheduler_settings) and the scheduler module dependency from the base config/install form display.
  • Adds an OOP SchedulerHooks class (#[Hook]) that seeds the bundleless Scheduler settings on hook_modules_installed and cleans them up on hook_modules_uninstalled (the procedural hook is a #[LegacyHook] shim superseded by the OOP modules_installed, so the logic lives in the hook class).

Scheduling is off by default, Scheduler owns it

  • The bundleless settings are seeded with publish_enable and unpublish_enable set to FALSE, 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 the publish_on/unpublish_on form 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 fataled updatedb on existing sites. Now points at the bundleless ai_context_item.ai_context_item.default display. (Surfaced while verifying this MR; small enough to fix inline rather than open a separate issue.)

Tests and docs

  • Adds AiContextSchedulerOptionalTest covering 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

Merge request reports

Loading