Loading modules/modeller_bpmn/src/ModellerBpmnBase.php +7 −2 Original line number Diff line number Diff line Loading @@ -760,7 +760,7 @@ abstract class ModellerBpmnBase extends ModellerBase { case 'checkboxes': case 'radios': case 'select': $fields[] = $this->optionsField($key, $label, $weight, $description, $definition['#options'], (string) $value); $fields[] = $this->optionsField($key, $label, $weight, $description, $definition['#options'], (string) $value, $definition['#required'] ?? FALSE); continue 2; } Loading Loading @@ -816,17 +816,22 @@ abstract class ModellerBpmnBase extends ModellerBase { * Key/value list of available options. * @param string $value * The default value for the field. * @param bool $required * The setting, if this field is required to be filled by the user. * * @return array * Prepared option field. */ protected function optionsField(string $name, string $label, int $weight, ?string $description, array $options, string $value): array { protected function optionsField(string $name, string $label, int $weight, ?string $description, array $options, string $value, bool $required = FALSE): array { $choices = []; foreach ($options as $optionValue => $optionName) { $choices[] = [ 'name' => (string) $optionName, 'value' => (string) $optionValue, ]; if ($required && $value === '') { $value = (string) $optionValue; } } $field = [ 'name' => $name, Loading modules/ui/src/Form/Import.php +9 −2 Original line number Diff line number Diff line Loading @@ -322,13 +322,20 @@ class Import extends FormBase { $replacement_storage = new StorageReplaceDataWrapper($active_storage); foreach ($source_storage->listAll() as $name) { $data = $source_storage->read($name); if (is_array($data)) { $replacement_storage->replaceData($name, $data); } else { $this->messenger()->addError($this->t('The contained config entity %name is invalid and got ignored.', [ '%name' => $name, ])); } } $source_storage = $replacement_storage; $storage_comparer = new StorageComparer($source_storage, $active_storage); if (!$storage_comparer->createChangelist()->hasChanges()) { $this->messenger()->addStatus(('There are no changes to import.')); $this->messenger()->addStatus('There are no changes to import.'); } else { $config_importer = new ConfigImporter( Loading modules/views/src/Plugin/Action/ViewsQuery.php +4 −1 Original line number Diff line number Diff line Loading @@ -93,8 +93,10 @@ class ViewsQuery extends ConfigurableActionBase { $form = parent::buildConfigurationForm($form, $form_state); $views = []; foreach (View::loadMultiple() as $view) { if ($view->status()) { $views[$view->id()] = $view->label(); } } $form['token_name'] = [ '#type' => 'textfield', '#title' => $this->t('Name of token'), Loading @@ -107,6 +109,7 @@ class ViewsQuery extends ConfigurableActionBase { '#default_value' => $this->configuration['view_id'], '#weight' => -50, '#options' => $views, '#required' => TRUE, ]; $form['display_id'] = [ '#type' => 'textfield', Loading Loading
modules/modeller_bpmn/src/ModellerBpmnBase.php +7 −2 Original line number Diff line number Diff line Loading @@ -760,7 +760,7 @@ abstract class ModellerBpmnBase extends ModellerBase { case 'checkboxes': case 'radios': case 'select': $fields[] = $this->optionsField($key, $label, $weight, $description, $definition['#options'], (string) $value); $fields[] = $this->optionsField($key, $label, $weight, $description, $definition['#options'], (string) $value, $definition['#required'] ?? FALSE); continue 2; } Loading Loading @@ -816,17 +816,22 @@ abstract class ModellerBpmnBase extends ModellerBase { * Key/value list of available options. * @param string $value * The default value for the field. * @param bool $required * The setting, if this field is required to be filled by the user. * * @return array * Prepared option field. */ protected function optionsField(string $name, string $label, int $weight, ?string $description, array $options, string $value): array { protected function optionsField(string $name, string $label, int $weight, ?string $description, array $options, string $value, bool $required = FALSE): array { $choices = []; foreach ($options as $optionValue => $optionName) { $choices[] = [ 'name' => (string) $optionName, 'value' => (string) $optionValue, ]; if ($required && $value === '') { $value = (string) $optionValue; } } $field = [ 'name' => $name, Loading
modules/ui/src/Form/Import.php +9 −2 Original line number Diff line number Diff line Loading @@ -322,13 +322,20 @@ class Import extends FormBase { $replacement_storage = new StorageReplaceDataWrapper($active_storage); foreach ($source_storage->listAll() as $name) { $data = $source_storage->read($name); if (is_array($data)) { $replacement_storage->replaceData($name, $data); } else { $this->messenger()->addError($this->t('The contained config entity %name is invalid and got ignored.', [ '%name' => $name, ])); } } $source_storage = $replacement_storage; $storage_comparer = new StorageComparer($source_storage, $active_storage); if (!$storage_comparer->createChangelist()->hasChanges()) { $this->messenger()->addStatus(('There are no changes to import.')); $this->messenger()->addStatus('There are no changes to import.'); } else { $config_importer = new ConfigImporter( Loading
modules/views/src/Plugin/Action/ViewsQuery.php +4 −1 Original line number Diff line number Diff line Loading @@ -93,8 +93,10 @@ class ViewsQuery extends ConfigurableActionBase { $form = parent::buildConfigurationForm($form, $form_state); $views = []; foreach (View::loadMultiple() as $view) { if ($view->status()) { $views[$view->id()] = $view->label(); } } $form['token_name'] = [ '#type' => 'textfield', '#title' => $this->t('Name of token'), Loading @@ -107,6 +109,7 @@ class ViewsQuery extends ConfigurableActionBase { '#default_value' => $this->configuration['view_id'], '#weight' => -50, '#options' => $views, '#required' => TRUE, ]; $form['display_id'] = [ '#type' => 'textfield', Loading