Commit da611e33 authored by Kingdutch's avatar Kingdutch

by Kingdutch: Remove existing content view handler.

We decided not to change existing views anymore but instead create
our own overview of all analysed entities. The added update hook
should remove our field for existing installations.

We don't touch any already set-up analysis as that'll correctly
get picked up in the configuration page.
parent 5875259f
......@@ -4,3 +4,22 @@
* @file
* Install, update, and uninstall functions for the Real-Time SEO module.
*/
use Drupal\views\Views;
/**
* Remove the SEO status from the content overview.
*/
function yoast_seo_update_8201() {
$content_view = Views::getView('content');
if ($content_view) {
$display_id = 'page_1';
$handlers = $content_view->getHandlers('field', $display_id);
if (isset($handlers['field_yoast_seo'])) {
$content_view->removeHandler($display_id, 'field', 'field_yoast_seo');
$content_view->save();
}
}
}
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment