fix: #3606822 Re-sync the synthetic kernel service in ClassResolver during site:install
Reroll of !16159 against the main branch per comment #6. Sibling of #3564735 for the plain site:install / ConfigInstaller path.
Problem
CLI drush site:install <profile> fatals when the profile installs a theme with OOP hooks (#3544715):
You have requested a synthetic service ("kernel"). The DIC does not know how to construct this service.After an install-time container rebuild, ClassResolver can hold a stale ContainerBuilder without the synthetic kernel set; resolving OOP-hook services whose autowiring reaches kernel then fatals. #3564735 fixed the ConfigImporter path only.
Solution
In ClassResolver::getInstanceFromDefinition(), re-sync the synthetic kernel from the live kernel when the container is a ContainerBuilder without it.
Validation
drush site:install varbase on Drupal ~11.3.13: fatals without the patch, completes with it (watchdog clean).
AI-Generated: Yes (Used Claude Code to diagnose the stale-container mechanism and author the change; reviewed and validated by Rajab Natshah; reviewed by Rajab Natshah.).
Checkpoints
- File an issue about this project
- Addition/Change/Update/Fix to this project
- Testing to ensure no regression
- Automated unit/functional testing coverage
- Developer Documentation support on feature change/addition
- User Guide Documentation support on feature change/addition
- UX/UI designer responsibilities
- Accessibility and Readability
- Reviewed by a human
- Code review by maintainers
- Full testing and approval
- Credit contributors
- Review with the product owner
- Update Release Notes
- Release