Commit fe6a5a06 authored by Dries's avatar Dries

- Patch #700194 by yched: optimize field_modules_disabled().

parent 7f4598d8
......@@ -234,17 +234,19 @@ function field_modules_enabled($modules) {
* Implements hook_modules_disabled().
*/
function field_modules_disabled($modules) {
foreach ($modules as $module) {
db_update('field_config')
->fields(array('active' => 0))
->condition('module', $module)
->execute();
db_update('field_config')
->fields(array('storage_active' => 0))
->condition('storage_module', $module)
->execute();
field_cache_clear(TRUE);
}
// Track fields whose field type is being disabled.
db_update('field_config')
->fields(array('active' => 0))
->condition('module', $modules, 'IN')
->execute();
// Track fields whose storage backend is being disabled.
db_update('field_config')
->fields(array('storage_active' => 0))
->condition('storage_module', $modules, 'IN')
->execute();
field_cache_clear(TRUE);
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment