Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292206

Convert theme hooks (defined by hook_theme()) to be objects

$
0
0

Problem/Motivation

There have been multiple issues lately involving the theme registry.
Because the theme hook arrays are passed around to many places, it is very difficult to track down which code is modifying which key.
It is also hard to full understand the ways that certain keys interact together.

This is very similar to the issues with the $form_state arrays in D7 and before.

Proposed resolution

Mimic the same solution used for $form_state: create a class to hold these theme hooks.
This time, we'll need full BC.

Remaining tasks

- review
- commit
- open follow-up #2873117: Remove ArrayAccess from ThemeHook

User interface changes

N/A

API changes

API addition and deprecation, no breaking changes
hook_theme() should now return an array of \Drupal\Core\Theme\ThemeHook objects
ThemeHook implements ArrayAccess for BC purposes.

Data model changes

N/A


Viewing all articles
Browse latest Browse all 292206

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>