Drupal8 Configuration objects provided already exist in active 错误解决
主题的制作经常基于已经开发好的基础主题,经常发生的事情是漏掉替换修改之前的数据,比如这个文件的配置:
mytheme/config/schema/mytheme.schema.yml
# Schema for the theme setting configuration file of the THEMETITLE theme. mytheme.settings: type: theme_settings label: 'mytheme settings'
如果没有修改之前就安装,当你在设置该主题为默认主题的时候意外的报错:
Drupal\Core\Config\PreExistingConfigException: Configuration objects (itso_front.settings) provided by itso_front already exist in active configuration in Drupal\Core\Config\PreExistingConfigException::create() (line 65 of core/lib/Drupal/Core/Config/PreExistingConfigException.php).
解决方法,删除已经存在的配置:
drush config-delete itso_front.settings