Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
google_tag-3353449
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
google_tag-3353449
Commits
8a7ca1dc
Commit
8a7ca1dc
authored
7 years ago
by
Jim Berry
Browse files
Options
Downloads
Patches
Plain Diff
Enhance clean up actions in hook_uninstall().
Delete realm variables and realm settings. Remove the snippet directory.
parent
b7019df0
No related branches found
Branches containing commit
Tags
7.x-1.2-rc3
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
google_tag.install
+24
-0
24 additions, 0 deletions
google_tag.install
with
24 additions
and
0 deletions
google_tag.install
+
24
−
0
View file @
8a7ca1dc
...
...
@@ -21,6 +21,30 @@ function google_tag_uninstall() {
db_delete
(
'variable'
)
->
condition
(
'name'
,
db_like
(
'google_tag_'
)
.
'%'
,
'LIKE'
)
->
execute
();
if
(
module_exists
(
'variable_realm'
)
&&
module_exists
(
'variable_store'
))
{
db_delete
(
'variable_store'
)
->
condition
(
'name'
,
db_like
(
'google_tag_'
)
.
'%'
,
'LIKE'
)
->
execute
();
// Remove variables from realm variable list.
$realms
=
variable_realm_list
();
foreach
(
$realms
as
$realm
=>
$label
)
{
$variables
=
variable_get
(
'variable_realm_list_'
.
$realm
,
array
());
if
(
$variables
)
{
foreach
(
$variables
as
$key
=>
$variable
)
{
if
(
substr
(
$variable
,
0
,
10
)
==
'google_tag'
)
{
unset
(
$variables
[
$key
]);
}
}
variable_set
(
'variable_realm_list_'
.
$realm
,
$variables
);
}
}
}
@
file_unmanaged_delete_recursive
(
'public://google_tag'
);
// @todo Is this relevant here or in _google_tag_snippets_save()?
drupal_clear_js_cache
();
}
...
...
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