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.module b/core/modules/shortcut/shortcut.module index cb67d4e..7f0dbf8 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)) { + // Themes 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/themes/seven/seven.install b/core/themes/seven/seven.install index 43faf47b..e69de29 100644 --- a/core/themes/seven/seven.install +++ b/core/themes/seven/seven.install @@ -1,17 +0,0 @@ -moduleExists('shortcut')) { - \Drupal::config('seven.settings')->set('third_party_settings.shortcut.module_link', TRUE)->save(); - } -}