Auto removal of missing module files?
cdale - October 12, 2009 - 01:33
| Project: | Utility |
| Version: | 6.x-3.x-dev |
| Component: | Module weights |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
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?
<?php
$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?

#1
http://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.