Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
easy_breadcrumb-3426967
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
easy_breadcrumb-3426967
Commits
36a97df9
Commit
36a97df9
authored
5 years ago
by
Greg Boggs
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
easy_breadcrumb.install
+24
-24
24 additions, 24 deletions
easy_breadcrumb.install
with
24 additions
and
24 deletions
easy_breadcrumb.install
+
24
−
24
View file @
36a97df9
...
...
@@ -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_800
2
(
&
$sandbox
)
{
function
easy_breadcrumb_update_800
3
(
&
$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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment