Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Y
yoast_seo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
yoast_seo
Commits
9e911344
Commit
9e911344
authored
Jan 30, 2018
by
chr.fritsch
Committed by
Kingdutch
Jan 30, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2940559
by chr.fritsch: Remove drush.inc
parent
a332acf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
58 deletions
+0
-58
drush/yoast_seo.drush.inc
drush/yoast_seo.drush.inc
+0
-58
No files found.
drush/yoast_seo.drush.inc
deleted
100644 → 0
View file @
a332acf1
<?php
/**
* @file
* Drush integration for the yoast_seo module.
*/
/**
* Implements hook_drush_command().
*/
function
yoast_seo_drush_command
()
{
$items
=
[];
// Command yoastseo-prepare-uninstall
// prepares the module to be uninstalled.
$items
[
'yoastseo-prepare-uninstall'
]
=
[
'description'
=>
"Prepare uninstalling Real-time SEO. Remove fields and data."
,
'aliases'
=>
[
'ypu'
],
];
return
$items
;
}
/**
* Prepare uninstall for yoast seo.
*
* This enables to delete the fields from drupal so uninstalling the module
* doesn't fail.
* It does 2 things :
* - Detach Yoast SEO from all yoastseo enabled content types
* - Purge the fields list from all temporary deleted fields.
*
* @see https://www.drupal.org/node/2418659
*/
function
drush_yoast_seo_yoastseo_prepare_uninstall
()
{
/** @var \Drupal\yoast_seo\SeoManager $yoast_seo_manager */
$yoast_seo_manager
=
\
Drupal
::
service
(
'yoast_seo.manager'
);
// 2) Detach Yoast SEO from all the content types it is attached to.
foreach
(
$yoast_seo_manager
->
getEnabledBundles
()
as
$entity_type_id
=>
$bundles
)
{
foreach
(
$bundles
as
$bundle_id
)
{
echo
"Detach Real-Time SEO fields for
{
$entity_type_id
}
{
$bundle_id
}
\n
"
;
$yoast_seo_manager
->
disableFor
(
$entity_type_id
,
$bundle_id
);
}
}
// 3) Purge field data.
do
{
field_purge_batch
(
1000
);
$properties
=
[
'deleted'
=>
TRUE
,
'include_deleted'
=>
TRUE
,
];
$fields
=
entity_load_multiple_by_properties
(
'field_config'
,
$properties
);
}
while
(
$fields
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment