public function FlexSlider::submitOptionsForm in Flex Slider 8.2
Handle any special handling on the validate form.
Overrides PluginBase::submitOptionsForm
File
- flexslider_views/
src/ Plugin/ views/ style/ FlexSlider.php, line 132
Class
- FlexSlider
- Style plugin to render each item in an ordered or unordered list.
Namespace
Drupal\flexslider_views\Plugin\views\styleCode
public function submitOptionsForm(&$form, FormStateInterface $form_state) {
parent::submitOptionsForm($form, $form_state);
/* Move flexslider options to the parent array so that
* values are saved properly.
* Original: values['style_options']['flexslider'] =
* ['options', 'caption', 'id'].
*/
$flexslider_options = $form_state
->getValue([
'style_options',
'flexslider',
]);
// Edit: values['style_options'] += ['options', 'caption', 'id'].
foreach ($flexslider_options as $key => $value) {
$form_state
->setValue([
'style_options',
$key,
], $value);
}
// Edit: values['style_options']['flexslider'] = NULL.
$form_state
->setValue([
'style_options',
'flexslider',
], NULL);
}