Commit 8361c942 authored by catch's avatar catch

Issue #2940165 by mondrake, Berdir: [regression] Cannot add effects to image style via the UI

parent 4e20e78d
......@@ -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;
}
/**
......
......@@ -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'));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment