Skip to content
Snippets Groups Projects
Verified Commit 2e403c17 authored by Lee Rowlands's avatar Lee Rowlands
Browse files

Issue #3256922 by danflanagan8, GaëlG: Warning on AJAX call when changing the...

Issue #3256922 by danflanagan8, GaëlG: Warning on AJAX call when changing the breakpoint_group field value of a responsive image style

(cherry picked from commit 9dc6f60e)
parent 9266e0ea
No related branches found
No related tags found
5 merge requests!8506Draft: Issue #3456536 by ibrahim tameme,!5646Issue #3350972 by nod_: [random test failure]...,!5600Issue #3350972 by nod_: [random test failure]...,!5343Issue #3305066 by quietone, Rename RedirectLeadingSlashesSubscriber,!3603#ISSUE 3346218 Add a different message on edit comment
......@@ -225,6 +225,7 @@ public function validateForm(array &$form, FormStateInterface $form_state) {
if ($form_state->getValue('breakpoint_group') != $form_state->getCompleteForm()['breakpoint_group']['#default_value']) {
// Remove the image style mappings since the breakpoint ID has changed.
$form_state->unsetValue('keyed_styles');
return;
}
// Check that at least 1 image style has been selected when using sizes.
......
......@@ -55,7 +55,7 @@ public function testResponsiveImageAdmin() {
$edit = [
'label' => 'Style One',
'id' => 'style_one',
'breakpoint_group' => 'responsive_image_test_module',
'breakpoint_group' => 'responsive_image',
'fallback_image_style' => 'thumbnail',
];
$this->drupalGet('admin/config/media/responsive-image-style/add');
......@@ -67,6 +67,15 @@ public function testResponsiveImageAdmin() {
$this->assertSession()->pageTextNotContains('There are no responsive image styles yet.');
$this->assertSession()->pageTextContains('Style One');
// Edit the breakpoint_group.
$this->drupalGet('admin/config/media/responsive-image-style/style_one');
$this->assertSession()->fieldValueEquals('label', 'Style One');
$this->assertSession()->fieldValueEquals('breakpoint_group', 'responsive_image');
$edit = [
'breakpoint_group' => 'responsive_image_test_module',
];
$this->submitForm($edit, 'Save');
// Edit the group.
$this->drupalGet('admin/config/media/responsive-image-style/style_one');
$this->assertSession()->fieldValueEquals('label', 'Style One');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment