diff --git a/core/modules/language/src/Entity/ContentLanguageSettings.php b/core/modules/language/src/Entity/ContentLanguageSettings.php index 28d60b1..084ea1e 100644 --- a/core/modules/language/src/Entity/ContentLanguageSettings.php +++ b/core/modules/language/src/Entity/ContentLanguageSettings.php @@ -12,7 +12,6 @@ use Drupal\Core\Entity\EntityStorageInterface; use Drupal\Core\Language\LanguageInterface; - /** * Defines the ContentLanguageSettings entity. * @@ -114,12 +113,12 @@ public function getDefaultLangcode() { /** * Sets if the language must be exposed or not. * - * @param bool $language_show + * @param bool $language_exposed * * @return $this */ - public function setLanguageExposed($language_show) { - $this->language_exposed = $language_show; + public function setLanguageExposed($language_exposed) { + $this->language_exposed = $language_exposed; return $this; } @@ -144,13 +143,13 @@ public function preSave(EntityStorageInterface $storage) { } /** - * Checks if this config object differs from default values in any property. + * Checks if this config object contains the default values in every property. * * @return bool - * True if any of the properties are the default values. False otherwise. + * True if all the properties contain the default values. False otherwise. */ - public function differsFromDefaultConfiguration() { - return ($this->language_exposed || $this->default_langcode != LanguageInterface::LANGCODE_SITE_DEFAULT); + public function isDefaultConfiguration() { + return (!$this->language_exposed && $this->default_langcode == LanguageInterface::LANGCODE_SITE_DEFAULT); } /** diff --git a/core/modules/language/src/Form/ContentLanguageSettingsForm.php b/core/modules/language/src/Form/ContentLanguageSettingsForm.php index af7aa41..d658d21 100644 --- a/core/modules/language/src/Form/ContentLanguageSettingsForm.php +++ b/core/modules/language/src/Form/ContentLanguageSettingsForm.php @@ -77,7 +77,7 @@ public function buildForm(array $form, FormStateInterface $form_state) { // Check whether we have any custom setting. foreach ($bundles[$entity_type_id] as $bundle => $bundle_info) { $config = ContentLanguageSettings::loadByEntityTypeBundle($entity_type_id, $bundle); - if ($config->differsFromDefaultConfiguration()) { + if (!$config->isDefaultConfiguration()) { $default[$entity_type_id] = $entity_type_id; } $language_configuration[$entity_type_id][$bundle]['language_exposed'] = $config->getLanguageExposed();