diff -u b/src/Form/JobItemForm.php b/src/Form/JobItemForm.php --- b/src/Form/JobItemForm.php +++ b/src/Form/JobItemForm.php @@ -225,30 +225,30 @@ $source_ui = $this->sourceManager->createUIInstance($item->getPlugin()); $source_ui->reviewFormSubmit($form, $form_state, $item); // Invoke the submit method on the translator controller (if available). - if ($item->hasTranslator()) { + if ($item->getTranslator()){ $translator_ui = $this->translatorManager->createUIInstance($item->getTranslator()->getPluginId()); $translator_ui->reviewFormSubmit($form, $form_state, $item); - - // Write changes back to item. - foreach ($form_state->getValues() as $key => $value) { - if (is_array($value) && isset($value['translation'])) { - // Update the translation, this will only update the translation in case - // it has changed. We have two different cases, the first is for nested - // texts. - if (is_array($value['translation'])) { - $data = array( - '#text' => $value['translation']['value'], - '#origin' => 'local', - ); - } else { - $data = array( - '#text' => $value['translation'], - '#origin' => 'local', - ); - } - - $item->addTranslatedData($data, $key); + } + // Write changes back to item. + foreach ($form_state->getValues() as $key => $value) { + if (is_array($value) && isset($value['translation'])) { + // Update the translation, this will only update the translation in case + // it has changed. We have two different cases, the first is for nested + // texts. + if (is_array($value['translation'])) { + $data = array( + '#text' => $value['translation']['value'], + '#origin' => 'local', + ); } + else { + $data = array( + '#text' => $value['translation'], + '#origin' => 'local', + ); + } + + $item->addTranslatedData($data, $key); } } // Check if the user clicked on 'Accept', 'Submit' or 'Reject'. only in patch2: unchanged: --- a/src/Entity/JobItem.php +++ b/src/Entity/JobItem.php @@ -722,7 +722,7 @@ class JobItem extends ContentEntityBase implements JobItemInterface { break; } } - if ($finished) { + if ($finished && $this->getJob()->hasTranslator()) { // There are no unfinished elements left. if ($this->getJob()->getTranslator()->isAutoAccept()) { // If the job item is going to be auto-accepted, set to review without