Problem/Motivation
On Drupal 11.3 and later, the **append_file_info** module triggers the following PHP warning:
Warning: Undefined array key "preprocess functions" in Drupal\append_file_info\Hook\ThemeHooks->themeRegistryAlter() (line 22 of modules/contrib/append_file_info/src/Hook/ThemeHooks.php).
This is caused by changes to the theme registry introduced in Drupal 11.3, where the `preprocess functions` array key is no longer guaranteed to exist for every theme hook.
Related Drupal core change: https://www.drupal.org/node/3504125
Steps to reproduce
1. Install Drupal 11.3 or later.
2. Install and enable the **append_file_info** module.
3. Rebuild caches.
4. Visit a page that triggers the module's `hook_theme_registry_alter()` implementation.
5. Observe the PHP warning in the logs or on-screen (if error display is enabled).
Proposed resolution
Update `ThemeHooks::themeRegistryAlter()` to account for the Drupal 11.3 theme registry changes by checking whether the `preprocess functions` key exists before attempting to access or modify it.
The implementation should be compatible with both older Drupal 11 releases and Drupal 11.3+.
Remaining tasks
* Update the implementation to safely handle missing `preprocess functions`.
* Verify compatibility with supported Drupal core versions.
* Add or update automated tests if applicable.
* Review and commit.
Issue fork append_file_info-3614232
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 #4
dkmishra commentedComment #6
p-neyens commented@dkmishra We have amended the proposal to ensure that the theme implementation in D11+ is retained
Comment #7
p-neyens commented