Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
I'm upgrading the Custom Search module which overrides the core Search module.
In order to customize the search result, I'm using hook_theme to register 'search_result'.
In D7, my module weight was set so it was run after the core Search hook_theme function.
In D8, my module weight is still set to run after core Search, but my hook_theme is run before it (seems to be run alphabetically, and Custom Search comes before Search), so it's useless now… core Search overrides my functions.
Comments
Comment #1
Berdir\Drupal\Core\Theme\Registry::build() uses getImplementations() like everything else. Are you sure that you are setting the weight correctly?
What does drush ev "var_dump(\Drupal::moduleHandler()->getImplementations('theme'))" print?
Maybe it is merged differently?
Comment #2
jdanthinne CreditAttribution: jdanthinne commentedModule weight is set by
module_set_weight('custom_search', 10);
in custom_search_install() function inside custom_search.install file.var_dump gives the following (seems alphabetical to me):
Comment #3
joelpittet@jdanthinne just stumbled on this. Not sure where the weight gets stored in D8 yet. I can reproduce on 8.0.x-dev so I'm moving to that so it doesn't get lost.
Comment #4
DuaelFrComment #5
jhedstromI think this is working now: