diff --git a/translators/tmgmt_local/src/LocalTaskInterface.php b/translators/tmgmt_local/src/LocalTaskInterface.php index 0484ce5..ad7c4a3 100644 --- a/translators/tmgmt_local/src/LocalTaskInterface.php +++ b/translators/tmgmt_local/src/LocalTaskInterface.php @@ -48,8 +48,8 @@ interface LocalTaskInterface extends ContentEntityInterface, EntityChangedInterf /** * Return the user assigned to this task. * - * @return \Drupal\Core\Session\AccountInterface - * The user assigned to this task. + * @return \Drupal\Core\Session\AccountInterface|NULL + * The user assigned to this task or NULL if there is no user assigned. */ public function getAssignee(); diff --git a/translators/tmgmt_local/src/Tests/LocalTranslatorTest.php b/translators/tmgmt_local/src/Tests/LocalTranslatorTest.php index efd7f67..a621038 100755 --- a/translators/tmgmt_local/src/Tests/LocalTranslatorTest.php +++ b/translators/tmgmt_local/src/Tests/LocalTranslatorTest.php @@ -367,6 +367,22 @@ class LocalTranslatorTest extends LocalTranslatorTestBase { $this->drupalGet('translate/items/' . $first_task_item->id()); $this->assertResponse(403); + $this->drupalLogin($this->admin_user); + + // Unassign the task. + $this->drupalGet('translate/' . $task->id()); + $edit = [ + 'tuid' => '', + ]; + $this->drupalPostForm(NULL, $edit, t('Save task')); + $this->clickLink(t('View')); + + // Assign again the task to himself. + $edit = [ + 'tuid' => $this->assignee->id(), + ]; + $this->drupalPostForm(NULL, $edit, t('Save task')); + $this->drupalLogin($this->assignee); // Translate the task.