function resource_conflict_update_7300 in Resource Conflict 7.3
Remove any duplicates types due to this bug: https://drupal.org/node/1872030.
We also can't trust that all the types in that array are accurate because of that bug. To address, we verify that each one should actually be there by checking the individual setting for that content type.
File
- ./
resource_conflict.install, line 41 - Install, upgrade and uninstall hooks for the resource conflict module.
Code
function resource_conflict_update_7300() {
$types = variable_get('rc_types', array());
if (!empty($types)) {
$deduped_types = array_unique($types);
}
foreach ($deduped_types as $index => $type) {
if (variable_get('rc_type_' . $type, 0) !== 1) {
// This content type should not be enabled.
unset($deduped_types[$index]);
}
}
variable_set('rc_types', $deduped_types);
}