diff --git a/core/modules/rdf/src/Entity/RdfMapping.php b/core/modules/rdf/src/Entity/RdfMapping.php index af4e307..577cbe7 100644 --- a/core/modules/rdf/src/Entity/RdfMapping.php +++ b/core/modules/rdf/src/Entity/RdfMapping.php @@ -51,31 +51,27 @@ class RdfMapping extends ConfigEntityBase implements RdfMappingInterface { * * @var array */ - protected $types; + protected $types = array(); /** * The mappings for fields on this bundle. * * @var array */ - protected $fieldMappings; + protected $fieldMappings = array(); /** * {@inheritdoc} */ public function getPreparedBundleMapping() { - $types = array(); - if (isset($this->types)) { - $types = $this->types; - } - return array('types' => $types); + return array('types' => $this->types); } /** * {@inheritdoc} */ public function getBundleMapping() { - if (isset($this->types)) { + if (!empty($this->types)) { return array('types' => $this->types); } return array(); diff --git a/core/modules/shortcut/shortcut.install b/core/modules/shortcut/shortcut.install index be6f8b2..d716a03 100644 --- a/core/modules/shortcut/shortcut.install +++ b/core/modules/shortcut/shortcut.install @@ -12,7 +12,6 @@ * Implements hook_schema(). */ function shortcut_schema() { - $schema['shortcut_set_users'] = array( 'description' => 'Maps users to shortcut sets.', 'fields' => array( @@ -49,3 +48,25 @@ function shortcut_schema() { return $schema; } + +/** + * Implements hook_install(). + */ +function shortcut_install() { + // Theme settings are not configuration entities and cannot depend on modules + // so to set a module-specific setting, we need to set it with logic. + if (\Drupal::service('theme_handler')->themeExists('seven')) { + \Drupal::config('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(); + } +} + +/** + * Implements hook_uninstall(). + */ +function shortcut_uninstall() { + // Theme settings are not configuration entities and cannot depend on modules + // so to unset a module-specific setting, we need to unset it with logic. + if (\Drupal::service('theme_handler')->themeExists('seven')) { + \Drupal::config('seven.settings')->clear('third_party_settings.shortcut.module_link')->save(); + } +} diff --git a/core/modules/shortcut/shortcut.module b/core/modules/shortcut/shortcut.module index cb67d4e..696a381 100644 --- a/core/modules/shortcut/shortcut.module +++ b/core/modules/shortcut/shortcut.module @@ -396,3 +396,16 @@ function shortcut_toolbar() { return $items; } + +/** + * Implements hook_themes_installed(). + */ +function shortcut_themes_installed($theme_list) { + if (in_array('seven', $theme_list)) { + // Theme settings are not configuration entities and cannot depend on modules + // so to set a module-specific setting, we need to set it with logic. + if (\Drupal::moduleHandler()->moduleExists('shortcut')) { + \Drupal::config('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(); + } + } +} diff --git a/core/modules/system/src/Form/ThemeSettingsForm.php b/core/modules/system/src/Form/ThemeSettingsForm.php index 44649d2..8e72246 100644 --- a/core/modules/system/src/Form/ThemeSettingsForm.php +++ b/core/modules/system/src/Form/ThemeSettingsForm.php @@ -182,7 +182,7 @@ public function buildForm(array $form, FormStateInterface $form_state, $theme = ); } - if ((!$theme) || in_array('favicon', $features) && $this->moduleHandler->moduleExists('file')) { + if (((!$theme) || in_array('favicon', $features)) && $this->moduleHandler->moduleExists('file')) { $form['favicon'] = array( '#type' => 'details', '#title' => t('Shortcut icon settings'), @@ -390,19 +390,19 @@ public function submitForm(array &$form, FormStateInterface $form_state) { // and use it in place of the default theme-provided file. if ($this->moduleHandler->moduleExists('file')) { if ($file = $values['logo_upload']) { - unset($values['logo_upload']); $filename = file_unmanaged_copy($file->getFileUri()); $values['default_logo'] = 0; $values['logo_path'] = $filename; $values['toggle_logo'] = 1; } if ($file = $values['favicon_upload']) { - unset($values['favicon_upload']); $filename = file_unmanaged_copy($file->getFileUri()); $values['default_favicon'] = 0; $values['favicon_path'] = $filename; $values['toggle_favicon'] = 1; } + unset($values['logo_upload']); + unset($values['favicon_upload']); // If the user entered a path relative to the system files directory for // a logo or favicon, store a public:// URI so the theme system can handle it. diff --git a/core/modules/system/src/Tests/Batch/PageTest.php b/core/modules/system/src/Tests/Batch/PageTest.php index 42800b7..c4b1b70 100644 --- a/core/modules/system/src/Tests/Batch/PageTest.php +++ b/core/modules/system/src/Tests/Batch/PageTest.php @@ -17,6 +17,15 @@ class PageTest extends WebTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php index aa2d800..93f75df 100644 --- a/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php +++ b/core/modules/system/src/Tests/Entity/EntityViewControllerTest.php @@ -17,6 +17,15 @@ class EntityViewControllerTest extends WebTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php b/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php index 50d299c..36c17d9 100644 --- a/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php +++ b/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php @@ -19,6 +19,15 @@ class ThemeHandlerTest extends KernelTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/Form/FormObjectTest.php b/core/modules/system/src/Tests/Form/FormObjectTest.php index 237d9e7..c41928a 100644 --- a/core/modules/system/src/Tests/Form/FormObjectTest.php +++ b/core/modules/system/src/Tests/Form/FormObjectTest.php @@ -18,6 +18,15 @@ class FormObjectTest extends SystemConfigFormTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php index ee54f31..22a2f7d 100644 --- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php +++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php @@ -19,6 +19,15 @@ class BreadcrumbTest extends MenuTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array @@ -41,7 +50,6 @@ protected function setUp() { // presence on the page, so we need to ensure that the Tools block will be // displayed in the admin theme. $this->drupalPlaceBlock('system_menu_block:tools', array( - 'machine' => 'system_menu_tools', 'region' => 'content', 'theme' => \Drupal::config('system.theme')->get('admin'), )); diff --git a/core/modules/system/src/Tests/Menu/MenuRouterTest.php b/core/modules/system/src/Tests/Menu/MenuRouterTest.php index 7de9006..4dd2e19 100644 --- a/core/modules/system/src/Tests/Menu/MenuRouterTest.php +++ b/core/modules/system/src/Tests/Menu/MenuRouterTest.php @@ -17,6 +17,15 @@ class MenuRouterTest extends WebTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/System/PageTitleTest.php b/core/modules/system/src/Tests/System/PageTitleTest.php index 98148cd..31020c9 100644 --- a/core/modules/system/src/Tests/System/PageTitleTest.php +++ b/core/modules/system/src/Tests/System/PageTitleTest.php @@ -20,6 +20,15 @@ class PageTitleTest extends WebTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php index 80d469a..8a7fd04 100644 --- a/core/modules/system/src/Tests/System/ThemeTest.php +++ b/core/modules/system/src/Tests/System/ThemeTest.php @@ -19,6 +19,15 @@ class ThemeTest extends WebTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/system/tests/modules/form_test/config/schema/form_test.schema.yml b/core/modules/system/tests/modules/form_test/config/schema/form_test.schema.yml new file mode 100644 index 0000000..3e38933 --- /dev/null +++ b/core/modules/system/tests/modules/form_test/config/schema/form_test.schema.yml @@ -0,0 +1,7 @@ +form_test.object: + type: mapping + label: 'Test form' + mapping: + bananas: + type: string + label: 'Bananas' diff --git a/core/themes/seven/config/install/seven.settings.yml b/core/themes/seven/config/install/seven.settings.yml deleted file mode 100644 index 6bba58b..0000000 --- a/core/themes/seven/config/install/seven.settings.yml +++ /dev/null @@ -1,3 +0,0 @@ -third_party_settings: - shortcut: - module_link: true