Download & Extend

Auto removal of missing module files?

Project:Util
Version:6.x-3.x-dev
Component:Module weights
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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?

Comments

#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.

#2

This 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.

#3

Status:active» fixed

#4

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.