Postponed
Project:
Drupal core
Version:
main
Component:
theme system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2026 at 03:14 UTC
Updated:
28 Apr 2026 at 06:15 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
nicxvan commentedComment #3
nicxvan commentedComment #4
debdeep.mukhopadhyay commentedI am working on this.
Comment #6
debdeep.mukhopadhyay commentedHi @nicxvan,
I worked on the issue related to deprecating theme-settings.php in the Olivero theme.
While setting up the issue fork on Drupal 12.x-dev, I faced some dependency and environment related conflicts which made it difficult to properly test the theme settings behaviour. To avoid blocking progress, I recreated the setup on a stable Drupal 11 environment and verified the approach there.
I moved the logic from theme-settings.php to a new OOP hook class (OliveroThemeSettingsHooks) using the Hook attribute, registered it via olivero.services.yml, removed the legacy file, rebuilt cache, and confirmed that the Olivero appearance settings page loads and saves correctly without errors.
Now I am continuing the work on the issue fork branch to prepare a Drupal 12 compatible patch/MR.
Please let me know if anything else needs to be validated before I proceed further.
Thanks.
Comment #7
rajivgandhi chinnakrishnan commentedConverts olivero/theme-settings.php to an OOP hook class (ThemeSettingsHooks) using the #[Hook] attribute, then deletes the procedural file. A deprecation notice (E_USER_DEPRECATED) is added to HookCollectorPass so any contrib or custom theme still shipping a theme-settings.php gets a clear, actionable warning on container rebuild. The theme_test theme's file is intentionally left untouched to preserve legacy test coverage.
Comment #8
nicxvan commented@debdeep.mukhopadhyay thank you, I'm not sure what you mean about 11.x, the MR you posted is against main which is what will become drupal 12 so I think it is correct.
That conversion is correct, we do need to do the actual deprecation.
We do not need the services file for the theme, in fact it does nothing so we should delete it.
For the deprecation it should happen in ThemeHookCollectorPass around line 224, if $isThemeSettings is TRUE I would output a deprecation message.
This issue will need a CR explaining the changes as well.
Edited to add: We also need to resolve the PHPCS errors:
@rajivgandhi chinnakrishnan we don't use patches any longer for core contributions. I am going to hide it.
Also that patch has several issues with it so please don't push it to the MR without discussion.
Briefly, it's the wrong collectorPass, it mentions a drupal version no longer supported, I have no idea what version of core it's against since the olivero theme-settings don't seem to align with 11 or main.
Comment #9
debdeep.mukhopadhyay commentedHi @nicxvan, @rajivgandhi chinnakrishnan,
Thank you for the guidance and review comments.
After the last feedback, I re-verified the implementation by testing the OOP conversion of theme-settings.php in both Drupal 11 (for behaviour comparison) and current main (future Drupal 12). I also updated the approach based on suggestions — removing the unnecessary services.yml, addressing PHPCS feedback, and ensuring the deprecation logic is placed in the correct compiler pass (ThemeHookCollectorPass).
The changes are now aligned with the current core structure and expected deprecation flow.
Kindly let me know if anything else needs improvement — happy to update further.
Thanks for reviewing 🙏
Comment #10
nicxvan commentedWe will need a test for the deprecation too, you can add a theme settings file to the test procedural hook theme
Comment #11
nicxvan commentedI pushed up a fix for the deprecation message format.
I only see one other sprintf in deprecations, but I left it here for now.
We do still need to add a test for the deprecation path since it's unique, but we should do this after the actual .theme deprecation.
#3581218: Deprecate .theme file extension
Comment #12
nicxvan commentedWhy did you change the hook implementation so much?
Comment #13
nicxvan commentedI'm very confused, both the MR and the patch have incorrect versions of the conversion. Can you both please provide information on how you did the conversion and why over 100 lines were deleted?
Comment #14
debdeep.mukhopadhyay commentedHi @nicxvan,
can you please little eleborate which part conversion seems incorrect,it's help me better for understand and for the right correction.