2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
@@ -315,7 +320,7 @@ function module_hook($module, $hook) {
* MODULE_IMPLEMENTS_WRITE_CACHE: Write the stored list of hook
* implementations into the cache_registry table.
* @param $sort
* By default, modules are ordered by weight and filename. By setting this
* By default, modules are ordered by weight and modulename. By setting this
* option to TRUE, modules will be ordered by module name.
* @return
* An array with the names of the modules which are implementing this hook.
...
...
@@ -350,6 +355,11 @@ function module_implements($hook, $sort = FALSE) {
$cached_hooks=count($implementations);
}
if(!isset($implementations[$hook])){
// The module name (rather than the filename) is used as the fallback
// weighting in order to guarantee consistent behavior across different
// Drupal installations, which might have modules installed in different
// locations in the file system. The ordering here must also be
// consistent with the one used in module_list().
$implementations[$hook]=db_query("SELECT module FROM {registry} WHERE type = 'function' AND suffix = :hook ORDER BY weight, module",array(':hook'=>$hook))->fetchCol();