Commit cdab062b authored by alexpott's avatar alexpott

Issue #2307053 by mondrake: Fixed Rotate effect UI does not allow to set...

Issue #2307053 by mondrake: Fixed Rotate effect UI does not allow to set background color to transparent.
parent 83fa87f8
......@@ -128,7 +128,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta
* {@inheritdoc}
*/
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
if (!Color::validateHex($form_state->getValue('bgcolor'))) {
if (!$form_state->isValueEmpty('bgcolor') && !Color::validateHex($form_state->getValue('bgcolor'))) {
form_set_error('bgcolor', $form_state, $this->t('Background color must be a hexadecimal color value.'));
}
}
......
......@@ -237,6 +237,17 @@ function testStyle() {
'%style' => $style->label,
)));
// Additional test on Rotate effect, for transparent background.
$edit = array(
'data[degrees]' => 5,
'data[random]' => 0,
'data[bgcolor]' => '',
);
$this->drupalPostForm($style_path, array('new' => 'image_rotate'), t('Add'));
$this->drupalPostForm(NULL, $edit, t('Add effect'));
$style = entity_load_unchanged('image_style', $style_name);
$this->assertEqual(count($style->getEffects()), 6, 'Rotate effect with transparent background was added.');
// Style deletion form.
// Delete the style.
......
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