Would it be possible to add a button that could remove missing module files? Or perhaps some docs on the code to run?
Something like the following perhaps?
$list = array_keys(module_rebuild_cache());
if (!empty($list)) {
db_query("DELETE FROM {system} WHERE type = 'module' AND name NOT IN (". db_placeholders($list, 'varchar') .")", $list);
}
Or perhaps another approach on the module weights page would be to simply use the list of modules as returned from module_rebuild_cache()? That way the extra weight fields would not show up.
Thoughts?
Comments
Comment #1
nancydruhttp://drupal.org/project/system_table_cleaner works for me.
IIRC, module_rebuild_cache() doesn't return something (weight, I think), so using it could produce a HUGE "in" clause or require a LOT of individual queries.
I'm thinking about cross-checking the two sources of data and just bypassing missing files altogether. I just need the time. Or someone to submit a patch.
Comment #2
nancydruThis was causing trouble on a site I'm trying to finish, so I updated the module. The field set description now points to the System Table Cleaner module. This module now bypasses missing module files and there is now also a setting to optionally issue a warning if a module has been deleted.
See also #664562: Module weights still displayed for deleted / uninstalled modules.
Comment #3
nancydru