Created
October 30, 2018 21:05
-
-
Save froboy/088db3244949045ba822dd8e8300bd6a to your computer and use it in GitHub Desktop.
Switch from standard to config_installer with an existing db on Drupal 8, via https://www.drupal.org/project/drupal/issues/2677722
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @file | |
* Install file for the Custom Module module. | |
*/ | |
/** | |
* Ensure site is using 'config_installer' profile. | |
*/ | |
function custom_module_update_8001(&$sandbox) { | |
\Drupal::configFactory()->getEditable('core.extension') | |
->set('profile', 'config_installer') | |
->save(); | |
drupal_flush_all_caches(); | |
\Drupal::service('module_installer')->install(['config_installer']); | |
\Drupal::service('module_installer')->uninstall(['standard']); | |
$sc = \Drupal::keyValue('system.schema'); | |
if ($sc->get('standard')) { | |
$sc->delete('standard'); | |
} | |
drupal_flush_all_caches(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment