diff --git a/core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php b/core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php index 03915c3a3f8..445216d9656 100644 --- a/core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php +++ b/core/modules/content_moderation/src/Form/ContentModerationConfigureEntityTypesForm.php @@ -178,9 +178,15 @@ class ContentModerationConfigureEntityTypesForm extends FormBase { $selected_bundles[$bundle_id] = $bundle['label']; } } + $selected_bundles_list = [ + '#theme' => 'item_list', + '#items' => $selected_bundles, + '#context' => ['list_style' => 'comma-list'], + '#empty' => $this->t('none'), + ]; $response = new AjaxResponse(); $response->addCommand(new CloseDialogCommand()); - $response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'))); + $response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), $selected_bundles_list)); return $response; } diff --git a/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php b/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php index f9520b65ace..6006c9abcbb 100644 --- a/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php +++ b/core/modules/content_moderation/src/Form/ContentModerationConfigureForm.php @@ -94,14 +94,21 @@ class ContentModerationConfigureForm extends WorkflowTypeConfigureFormBase imple } } + $selected_bundles_list = [ + '#theme' => 'item_list', + '#items' => $selected_bundles, + '#context' => ['list_style' => 'comma-list'], + '#empty' => $this->t('none'), + ]; $form['entity_types_container']['entity_types'][$entity_type->id()] = [ 'type' => [ - 'label' => ['#markup' => '' . $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]) . ''], - 'selected' => [ - '#prefix' => '
', - '#markup' => !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'), - '#suffix' => '', - ], + '#type' => 'inline_template', + '#template' => '{{ label }}
{{ selected_bundles }}', + '#context' => [ + 'label' => $this->t('@bundle types', ['@bundle' => $entity_type->getLabel()]), + 'entity_type_id' => $entity_type->id(), + 'selected_bundles' => $selected_bundles_list, + ] ], 'operations' => [ '#type' => 'operations',