Skip to content
Snippets Groups Projects
Commit 1c385292 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #2573221 by Jelle_S: Keyed mapping static cache is not rebuilt when...

Issue #2573221 by Jelle_S: Keyed mapping static cache is not rebuilt when overwriting an existing mapping
parent d59b8799
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -112,6 +112,7 @@ public function addImageStyleMapping($breakpoint_id, $multiplier, array $image_s ...@@ -112,6 +112,7 @@ public function addImageStyleMapping($breakpoint_id, $multiplier, array $image_s
'breakpoint_id' => $breakpoint_id, 'breakpoint_id' => $breakpoint_id,
'multiplier' => $multiplier, 'multiplier' => $multiplier,
) + $image_style_mapping; ) + $image_style_mapping;
$this->keyedImageStyleMappings = NULL;
return $this; return $this;
} }
} }
......
...@@ -252,6 +252,19 @@ public function testGetKeyedImageStyleMappings() { ...@@ -252,6 +252,19 @@ public function testGetKeyedImageStyleMappings() {
'image_mapping' => 'medium', 'image_mapping' => 'medium',
); );
$this->assertEquals($expected, $entity->getKeyedImageStyleMappings()); $this->assertEquals($expected, $entity->getKeyedImageStyleMappings());
// Overwrite a mapping to ensure keyed mapping static cache is rebuilt.
$entity->addImageStyleMapping('test_breakpoint2', '2x', array(
'image_mapping_type' => 'image_style',
'image_mapping' => 'large',
));
$expected['test_breakpoint2']['2x'] = array(
'breakpoint_id' => 'test_breakpoint2',
'multiplier' => '2x',
'image_mapping_type' => 'image_style',
'image_mapping' => 'large',
);
$this->assertEquals($expected, $entity->getKeyedImageStyleMappings());
} }
/** /**
......
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