degov-8.x-2.0/modules/degov_media_document/degov_media_document.install
modules/degov_media_document/degov_media_document.install
<?php
/**
* Implements hook_uninstall().
*/
function degov_media_document_upload_uninstall() {
// Remove the document bundle dependency on the entity media browser.
$dependencies = \Drupal::config('entity_browser.browser.media_browser')
->get('dependencies.config');
foreach ($dependencies as $key => $dependency) {
if ($dependency == 'media.type.document') {
unset($dependencies[$key]);
}
}
$dependencies = array_values($dependencies);
\Drupal::configFactory()->getEditable('entity_browser.browser.media_browser')
->set('dependencies.config', $dependencies)
->save(TRUE);
// Remove the document tab from the entity media browser.
$key = "88a662a5-10c0-4229-b807-07b76e36b771";
$widgets = \Drupal::config("entity_browser.browser.media_browser")
->get("widgets");
if (!empty($widgets[$key])) {
unset($widgets[$key]);
\Drupal::configFactory()->getEditable("entity_browser.browser.media_browser")
->set("widgets", $widgets)
->save(TRUE);
}
}
/**
* Next module update version is 8008.
* All update hooks from 1.1 to 1.14 were deleted.
* There is no upgrade path from 1.1 to 1.14, you need first to update to 1.2
* and every minor release as well until 1.14 respectively.
* The fresh install should have all the changes from 1.1 to 1.14.
*/
