Skip to content
Snippets Groups Projects
Commit 36a97df9 authored by Greg Boggs's avatar Greg Boggs
Browse files

reorder update hooks so there are no dupes and they are all in the correct order in the file

parent dd1c1a35
No related branches found
No related tags found
No related merge requests found
......@@ -19,12 +19,34 @@ function easy_breadcrumb_update_8001(&$sandbox) {
// Do nothing because database updates run cache rebuild.
}
/**
* Implements hook_update().
*
* Update home_segment_keep config from integer to boolean.
*/
function easy_breadcrumb_update_8002() {
$config = \Drupal::configFactory()->getEditable('easy_breadcrumb.settings');
$home_segment_keep = $config->get(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP);
// If the setting is enabled, store it as TRUE.
if ($home_segment_keep === 1) {
$config->set(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP, TRUE);
}
// Otherwise, store it as FALSE.
else {
$config->set(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP, FALSE);
}
$config->save();
}
/**
* Implements hook_update().
*
* Force an update because we updated the depedency injection which requires a cache clear.
*/
function easy_breadcrumb_update_8002(&$sandbox) {
function easy_breadcrumb_update_8003(&$sandbox) {
// Do nothing because database updates run cache rebuild.
}
......@@ -44,26 +66,4 @@ function easy_breadcrumb_install() {
// Clear the cache tags so that the new breadcrumbs appear after install.
Cache::invalidateTags(['rendered']);
}
/**
* Implements hook_update().
*
* Update home_segment_keep config from integer to boolean.
*/
function easy_breadcrumb_update_8002() {
$config = \Drupal::configFactory()->getEditable('easy_breadcrumb.settings');
$home_segment_keep = $config->get(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP);
// If the setting is enabled, store it as TRUE.
if ($home_segment_keep === 1) {
$config->set(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP, TRUE);
}
// Otherwise, store it as FALSE.
else {
$config->set(EasyBreadcrumbConstants::HOME_SEGMENT_KEEP, FALSE);
}
$config->save();
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment