diff --git a/src/Plugin/search_api/datasource/ContentEntity.php b/src/Plugin/search_api/datasource/ContentEntity.php index 113ad3c..a26306b 100644 --- a/src/Plugin/search_api/datasource/ContentEntity.php +++ b/src/Plugin/search_api/datasource/ContentEntity.php @@ -264,18 +264,23 @@ class ContentEntity extends DatasourcePluginBase { $all_languages = $this->getLanguageManager()->getLanguages(); $configuration = $this->configuration; - if ($configuration['default']) { - $allowed_languages = $all_languages; - foreach ($configuration['languages'] as $langcode) { - unset($allowed_languages[$langcode]); + + if ($this->isTranslatable()) { + if ($configuration['default']) { + $allowed_languages = $all_languages; + foreach ($configuration['languages'] as $langcode) { + unset($allowed_languages[$langcode]); + } } - } - else { - foreach ($configuration['languages'] as $langcode => $checked) { - if ($checked === $langcode) { - $allowed_languages[$langcode] = $all_languages[$langcode]; + else { + foreach ($configuration['languages'] as $langcode => $checked) { + if ($checked === $langcode) { + $allowed_languages[$langcode] = $all_languages[$langcode]; + } } } + } else { + $allowed_languages = $all_languages; } /** @var \Drupal\Core\Entity\ContentEntityInterface[] $entities */