Loading core/modules/taxonomy/src/TermForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ protected function actions(array $form, FormStateInterface $form_state) { '#value' => $this->t('Save and go to list'), '#weight' => 20, '#submit' => array_merge($element['submit']['#submit'], ['::overview']), '#access' => $this->currentUser()->hasPermission('access taxonomy overview'), ]; } Loading core/modules/taxonomy/tests/src/Functional/TermTest.php +10 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ protected function setUp(): void { $this->drupalLogin($this->drupalCreateUser([ 'administer taxonomy', 'access taxonomy overview', 'bypass node access', ])); $this->vocabulary = $this->createVocabulary(); Loading Loading @@ -437,6 +438,15 @@ public function testTermInterface() { // parameter is present. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', ['query' => ['destination' => 'node/add']]); $this->assertSession()->pageTextNotContains('Save and go to list'); // Validate that "Save and go to list" doesn't exist when missing permission // 'access taxonomy overview'. $this->drupalLogin($this->drupalCreateUser([ 'administer taxonomy', 'bypass node access', ])); $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); $this->assertSession()->pageTextNotContains('Save and go to list'); } /** Loading Loading
core/modules/taxonomy/src/TermForm.php +1 −0 Original line number Diff line number Diff line Loading @@ -109,6 +109,7 @@ protected function actions(array $form, FormStateInterface $form_state) { '#value' => $this->t('Save and go to list'), '#weight' => 20, '#submit' => array_merge($element['submit']['#submit'], ['::overview']), '#access' => $this->currentUser()->hasPermission('access taxonomy overview'), ]; } Loading
core/modules/taxonomy/tests/src/Functional/TermTest.php +10 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,7 @@ protected function setUp(): void { $this->drupalLogin($this->drupalCreateUser([ 'administer taxonomy', 'access taxonomy overview', 'bypass node access', ])); $this->vocabulary = $this->createVocabulary(); Loading Loading @@ -437,6 +438,15 @@ public function testTermInterface() { // parameter is present. $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add', ['query' => ['destination' => 'node/add']]); $this->assertSession()->pageTextNotContains('Save and go to list'); // Validate that "Save and go to list" doesn't exist when missing permission // 'access taxonomy overview'. $this->drupalLogin($this->drupalCreateUser([ 'administer taxonomy', 'bypass node access', ])); $this->drupalGet('admin/structure/taxonomy/manage/' . $this->vocabulary->id() . '/add'); $this->assertSession()->pageTextNotContains('Save and go to list'); } /** Loading