function lingotek_update_7507 in Lingotek Translation 7.7
Same name and namespace in other branches
- 7.5 lingotek.install \lingotek_update_7507()
- 7.6 lingotek.install \lingotek_update_7507()
Reset any bundles currently set to legacy profile 'CUSTOM' to be 'MANUAL'.
File
- ./
lingotek.install, line 827
Code
function lingotek_update_7507(&$sandbox) {
$entity_profiles = variable_get('lingotek_entity_profiles', NULL);
$custom_bundles = array();
foreach ($entity_profiles as $entity_type => $bundles) {
foreach ($bundles as $bundle_name => $profile) {
if ($profile == LingotekSync::PROFILE_CUSTOM) {
$entity_profiles[$entity_type][$bundle_name] = LingotekSync::PROFILE_MANUAL;
$custom_bundles[] = "{$bundle_name} ({$entity_type})";
}
}
}
if (!empty($custom_bundles)) {
variable_set('lingotek_entity_profiles', $entity_profiles);
$message = "The following content types have been reset from profile 'CUSTOM' to profile 'MANUAL': " . implode(', ', $custom_bundles) . " (The 'CUSTOM' profile is now reserved for individual entities only and is no longer supported at the content-type level.)";
return $message;
}
}