Commit b71005a2 authored by japerry's avatar japerry Committed by borisson_

Issue #2868601 by borisson_, japerry: PluginNotFoundException with new release

parent 82e13a43
......@@ -62,3 +62,27 @@ function facets_update_8001() {
}
}
}
/**
* Remove 'other_facet' plugin for older versions of facets.
*/
function facets_update_8002() {
$database = \Drupal::database();
$query = $database
->query("SELECT * FROM {config} WHERE data LIKE '%other_facet%'");
$results = $query->fetchAll();
foreach ($results as $result) {
$data = unserialize($result->data);
if (isset($data['visibility']['other_facet'])) {
unset($data['visibility']['other_facet']);
}
$database->update('config')
->fields(array(
'data' => serialize($data),
))
->condition('name', $result->name)
->execute();
}
}
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