diff --git a/src/Form/WebformVariantFormBase.php b/src/Form/WebformVariantFormBase.php index afe4cec8c..c4ddbd8ea 100644 --- a/src/Form/WebformVariantFormBase.php +++ b/src/Form/WebformVariantFormBase.php @@ -154,7 +154,7 @@ abstract class WebformVariantFormBase extends FormBase { if (count($variant_options) === 1) { $form['general']['element_key'] = [ '#type' => 'value', - '#value' => array_key_first($variant_options), + '#value' => key($variant_options), ]; $form['general']['element_key_item'] = [ '#title' => $this->t('Element'),