Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have a few other modules that use hook_theme_registry_alter to make changes to theme paths, but it all stops working when advanced_forum is installed.
Looking at the code from line 317 in advanced_forum.module, this loop seems to be causing the problem and seems to get very confused with the existing path.
// If there was a path in there, store it.
$existing_path = array_shift($theme_registry[$template]['theme paths']);
// Add paths for our style and ancestors before the existing path, if any.
foreach ($lineage AS $style => $style_path) {
array_unshift($theme_registry[$template]['theme paths'], $existing_path, $style_path);
$existing_path = array_shift($theme_registry[$template]['theme paths']);
}
It removes the first existing path and then for each iteration it adds it and then removes it once again, leaving it off at the end and I can't see why.
Patch to follow....
Comment | File | Size | Author |
---|---|---|---|
#1 | 1415742-prevent-theme-registry-alter-clearing.patch | 1.58 KB | smoothify |
Comments
Comment #1
smoothify CreditAttribution: smoothify commentedThis patch simplifies things, it simply adds the new advanced forums paths before anything else, then it adds the existing paths, finally its followed by the theme ancestor paths.