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 had warnings on cache rebuild about a missing module:
WD system: The following module is missing from the file system: . [error]
So the missing module is "".
This came from elysia_cron, rebuilding the menu entry of "admin/config/system/cron/status" with a parent entry menu in "admin/config/system/cron" and this parent entry had an empty string in the module key.
There is this code in elysia_cron_menu()
if (EC_DRUPAL_VERSION >= 7) {
// Override standard cron page
function elysia_cron_menu_alter(&$items) {
$items['admin/config/system/cron'] = array(
'title' => 'Cron Settings',
'description' => 'View and manage cron table',
'page callback' => 'elysia_cron_admin_page',
'access arguments' => array('administer elysia_cron'),
);
}
}
Enforcing the module record like that solved the issue:
if (EC_DRUPAL_VERSION >= 7) {
// Override standard cron page
function elysia_cron_menu_alter(&$items) {
$items['admin/config/system/cron'] = array(
'title' => 'Cron Settings',
'description' => 'View and manage cron table',
'page callback' => 'elysia_cron_admin_page',
'access arguments' => array('administer elysia_cron'),
'module' => 'elysia_cron',
);
}
}
Comment | File | Size | Author |
---|---|---|---|
#5 | elysia_cron-2407129-5-D7.patch | 435 bytes | chaby |
Comments
Comment #1
regilero CreditAttribution: regilero commentedpatch attached.
Some recent issues are maybe linked to that, #2389835 or #2351151
Comment #2
Simon Georges CreditAttribution: Simon Georges commented(adding possibly related issues)
Comment #3
Simon Georges CreditAttribution: Simon Georges commentedChanging status, as there is a patch.
Comment #4
joelpittetTracked this down with the help of this core patch: #1081266: Avoid re-scanning module directory when a filename or a module is missing
This is RTBC even though the patch file extension is .txt, it's still a valid patch:)
Comment #5
chaby CreditAttribution: chaby commentedHuuum, I think that 'module' key should still be "system" (even if it doesn't make sense anymore, it seems to be used with menu links).
Anyway, this issue seens to happen because with this hook, you are supposed to override only what you need, not the entire menu entries. That's why 'module' key is removed accidentally (added by menu_router_build()).
So here is an another patch for purpose only which should fix it by altering only what's needed. Not tested because I strangely cannot reproduce it, that's why I did'nt revert the issue status to needs review.
Comment #6
Fabianx CreditAttribution: Fabianx for Drupal Association commentedRTBC for #5
Comment #7
joelpittetThanks @chaby and @Fabianx shouldn't it also help find where the callback is by loading the correct module?
I like the idea of unioning on the defaults, though not sure where 'file' was pointing before, I'd like to step through this.
Comment #8
joelpittetOk cool, tested and no issues to speak of, only diff is the #weight get's set from the original and an argument is passed into the page callback, but it's not used.
RTBC+1 on #5
Comment #9
chaby CreditAttribution: chaby commented@joelpittet :
If you are talking about the key 'module', it don't think so. Because first of all, all .module files are already loaded at bootstrap level before dealing with the menu router. Then, it should be keys 'file' and 'file_path' which help to find the callback (i.e : load an extra files not already included).
But as say in #5, I think that key 'module' is only used when (re)building menu links mapped with menu router (menu links have a reference to the module)...However, I'm not sure and did'nt have time to investigate more on it. In fact to be honest, I never paid attention to this because I always override menu entries in that way (so keeping the original 'module' key) without any problems...
Anyway, I'm curious to have the answer !
Comment #10
Fabianx CreditAttribution: Fabianx commentedSo a wrong module is likely only a problem if you use a module like 'js' that needs to work outside of a full bootstrap. (and that has a whole slew of other problems)
And even then this probably will use more the 'include_file' key of the menu router. (@see https://api.drupal.org/api/drupal/includes%21menu.inc/function/menu_exec...)
So I don't think 'module' or any other key in there is ever used inside of Drupal core, so this should be okay.
Comment #11
joelpittetBump
Comment #13
kala4ekGreat, committed to latest dev.
Comment #14
joelpittetThank you @kala4ek