This is probably technically a feature, but it 1) breaks no existing APIs, 2) adds something that we're starting to see needs to be there, thanks to modules like devel.module having really interesting needs to dig into the theme_registry, and 3) is only 1 line + 1 comment that provides very little in the way of risk or liability.

This patch introduces hook_theme_registry_alter(). Documentation will need to follow, obviously, but that goes in the hook documentation.

theme-registry-alter.patch621 bytesmerlinofchaos
Members fund testing for the Drupal project. Drupal Association Learn more


moshe weitzman’s picture

Status: Needs review » Reviewed & tested by the community

I tested with the code below in devel.module and the registry did alter properly (use devel.module's theme registry link to verify).

function devel_theme_registry_alter(&$cache) {
  $cache['color_scheme_form']['arguments']['form'] = 'foo';

there is no significant performance impact since a registry rebuild is an infrequent event.

dvessel’s picture

Nothing to really add here but this ability was already here by going through a crazy hack and this cleans it up!


Gábor Hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

OK, committed.

Anonymous’s picture

Status: Fixed » Closed (fixed)