Commit 16ea8500 authored by catch's avatar catch
Browse files

Issue #2994000 by Lendude, Pasqualle, quietone, pameeela: Notice in logs when...

Issue #2994000 by Lendude, Pasqualle, quietone, pameeela: Notice in logs when setting invalid translation config for a content type

(cherry picked from commit da9a2b40)
parent 37132a2e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -619,7 +619,7 @@ function content_translation_language_configuration_element_validate($element, F
  $values = $form_state->getValue($key);
  if (!$values['language_alterable'] && $values['content_translation'] && \Drupal::languageManager()->isLanguageLocked($values['langcode'])) {
    foreach (\Drupal::languageManager()->getLanguages(LanguageInterface::STATE_LOCKED) as $language) {
      $locked_languages[] = $language->getName();
      $locked_languages[$language->getId()] = $language->getName();
    }
    // @todo Set the correct form element name as soon as the element parents
    //   are correctly set. We should be using NestedArray::getValue() but for
+11 −0
Original line number Diff line number Diff line
@@ -204,6 +204,17 @@ public function testSettingsUI() {
      $this->assertEquals($definitions['body']->isTranslatable(), $field->isTranslatable(), 'Configurable field translatability correctly switched.');
    }

    // Test that we can't use the 'Not specified' default language when it is
    // not showing in the language selector.
    $edit = [
      'language_configuration[langcode]' => 'und',
      'language_configuration[language_alterable]' => FALSE,
      'language_configuration[content_translation]' => TRUE,
    ];
    $this->drupalGet('admin/structure/types/manage/article');
    $this->submitForm($edit, 'Save content type');
    $this->getSession()->getPage()->hasContent('"Show language selector" is not compatible with translating content that has default language: und. Either do not hide the language selector or pick a specific language.');

    // Test that the order of the language list is similar to other language
    // lists, such as in Views UI.
    $this->drupalGet('admin/config/regional/content-language');