Commit 1c385292 authored by alexpott's avatar alexpott

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
......@@ -112,6 +112,7 @@ public function addImageStyleMapping($breakpoint_id, $multiplier, array $image_s
'breakpoint_id' => $breakpoint_id,
'multiplier' => $multiplier,
) + $image_style_mapping;
$this->keyedImageStyleMappings = NULL;
return $this;
}
}
......
......@@ -252,6 +252,19 @@ public function testGetKeyedImageStyleMappings() {
'image_mapping' => 'medium',
);
$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());
}
/**
......
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