diff --git a/core/modules/image/src/ImageStyleListBuilder.php b/core/modules/image/src/ImageStyleListBuilder.php index 62651cd2f82a1b7b1f3d84dbab17ef2ea8d0c330..2dcb800afae76b5fcb1b0a4bc777ebc9b8ace2f5 100644 --- a/core/modules/image/src/ImageStyleListBuilder.php +++ b/core/modules/image/src/ImageStyleListBuilder.php @@ -39,9 +39,17 @@ public function getDefaultOperations(EntityInterface $entity) { 'url' => $entity->urlInfo('flush-form'), ]; - return parent::getDefaultOperations($entity) + [ + $operations = parent::getDefaultOperations($entity) + [ 'flush' => $flush, ]; + + // Remove destination URL from the edit link to allow editing image + // effects. + if (isset($operations['edit'])) { + $operations['edit']['url'] = $entity->toUrl('edit-form'); + } + + return $operations; } /** diff --git a/core/modules/image/src/Tests/ImageAdminStylesTest.php b/core/modules/image/src/Tests/ImageAdminStylesTest.php index 38fd98487606a7a3f15dbc33bc8c26857313a736..1f6f411054f6a28c9cf6393474ccfd17d8e64862 100644 --- a/core/modules/image/src/Tests/ImageAdminStylesTest.php +++ b/core/modules/image/src/Tests/ImageAdminStylesTest.php @@ -422,9 +422,20 @@ public function testEditEffect() { // Edit the scale effect that was just added. $this->clickLink(t('Edit')); $this->drupalPostForm(NULL, ['data[width]' => '24', 'data[height]' => '19'], t('Update effect')); - $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add')); - // Add another scale effect and make sure both exist. + // Add another scale effect and make sure both exist. Click through from + // the overview to make sure that it is possible to add new effect then. + $this->drupalGet('admin/config/media/image-styles'); + $rows = $this->xpath('//table/tbody/tr'); + $i = 0; + foreach ($rows as $row) { + if (((string) $row->td[0]) === 'Test style scale edit scale') { + $this->clickLink('Edit', $i); + break; + } + $i++; + } + $this->drupalPostForm(NULL, ['new' => 'image_scale'], t('Add')); $this->drupalPostForm(NULL, ['data[width]' => '12', 'data[height]' => '19'], t('Add effect')); $this->assertText(t('Scale 24×19')); $this->assertText(t('Scale 12×19'));