function thunder_update_dependencies in Thunder 8.4
Same name and namespace in other branches
- 8.5 thunder.install \thunder_update_dependencies()
- 8.2 thunder.install \thunder_update_dependencies()
- 8.3 thunder.install \thunder_update_dependencies()
- 6.2.x thunder.install \thunder_update_dependencies()
- 6.0.x thunder.install \thunder_update_dependencies()
- 6.1.x thunder.install \thunder_update_dependencies()
Update hook dependencies.
Ensure that Thunder updates come last so entity schema updates and more fundamental updates occur first.
Return value
mixed Returns list of update hook dependencies.
File
- ./
thunder.install, line 22 - Install, update and uninstall functions for the thunder installation profile.
Code
function thunder_update_dependencies() {
$dependencies['thunder'] = [];
// Ensure that all thunder hook_update_N functions are called after all other
// update hooks.
$list = [];
$return = [];
$updates = update_get_update_list();
// List of thunder modules with hook_update_N() functions.
$thunder_module_list = [
'thunder',
'thunder_article',
'thunder_liveblog',
'thunder_media',
'thunder_paragraphs',
'thunder_taxonomy',
'thunder_fia',
'thunder_riddle',
];
foreach ($updates as $module => $info) {
if (in_array($module, $thunder_module_list, TRUE)) {
// Build a list of thunder modules with updates to run.
$return[$module] = [];
}
else {
// Build the list of all the update hooks for thunder updates to depend
// on.
$pending = array_keys($info['pending']);
$list[$module] = array_pop($pending);
}
}
// Add the dependencies to the thunder modules with updates to run.
foreach ($return as $module => &$info) {
$info[$updates[$module]['start']] = $list;
}
return NestedArray::mergeDeepArray([
$return,
$dependencies,
], TRUE);
}