Commit 0a25fbcc authored by NickWilde's avatar NickWilde

Fix: Standards Error. Array over 80 char. Just get the parent value once

and check child values with array access syntax.
parent 9f27136c
...@@ -522,17 +522,18 @@ class Cycle extends ViewsSlideshowTypeBase { ...@@ -522,17 +522,18 @@ class Cycle extends ViewsSlideshowTypeBase {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function validateConfigurationForm(array &$form, FormStateInterface $form_state) { public function validateConfigurationForm(array &$form, FormStateInterface $form_state) {
if (!is_numeric($form_state->getValue(['style_options', 'views_slideshow_cycle', 'timeout']))) { $values = $form_state->getValue(['style_options', 'views_slideshow_cycle']);
if (!is_numeric($values['timeout'])) {
$form_state->setErrorByName('style_options][views_slideshow_cycle][timeout', t('@setting must be numeric!', $form_state->setErrorByName('style_options][views_slideshow_cycle][timeout', t('@setting must be numeric!',
['@setting' => t('Timeout')] ['@setting' => t('Timeout')]
)); ));
} }
if (!is_numeric($form_state->getValue(['style_options', 'views_slideshow_cycle', 'speed']))) { if (!is_numeric($values['speed'])) {
$form_state->setErrorByName('style_options][views_slideshow_cycle][speed', t('@setting must be numeric!', $form_state->setErrorByName('style_options][views_slideshow_cycle][speed', t('@setting must be numeric!',
['@setting' => t('Speed')] ['@setting' => t('Speed')]
)); ));
} }
if (!is_numeric($form_state->getValue(['style_options', 'views_slideshow_cycle', 'remember_slide_days']))) { if (!is_numeric($values['remember_slide_days'])) {
$form_state->setErrorByName('style_options][views_slideshow_cycle][remember_slide_days', t('@setting must be numeric!', $form_state->setErrorByName('style_options][views_slideshow_cycle][remember_slide_days', t('@setting must be numeric!',
['@setting' => t('Slide days')] ['@setting' => t('Slide days')]
)); ));
......
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