diff --git a/core/modules/content_moderation/content_moderation.routing.yml b/core/modules/content_moderation/content_moderation.routing.yml index 0c94867..b511ab3 100644 --- a/core/modules/content_moderation/content_moderation.routing.yml +++ b/core/modules/content_moderation/content_moderation.routing.yml @@ -1,4 +1,4 @@ -workflow.update_entity_type_form: +workflow.type_edit_form: path: '/admin/config/workflow/workflows/manage/{workflow}/type/{entity_type_id}' defaults: _form: '\Drupal\content_moderation\Form\WorkflowTypeEditForm' diff --git a/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php b/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php index 981f654..a310539 100644 --- a/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php +++ b/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php @@ -94,8 +94,7 @@ public function buildForm(array $form, FormStateInterface $form_state, WorkflowI throw new NotFoundHttpException(); } - $options = []; - $defaults =[]; + $options = $defaults = []; foreach ($this->bundleInfo->getBundleInfo($this->entityType->id()) as $bundle_id => $bundle) { // Check if moderation is enabled for this bundle on any workflow. $moderation_enabled = $this->moderationInformation->shouldModerateEntitiesOfBundle($this->entityType, $bundle_id); @@ -174,7 +173,7 @@ public function ajaxCallback() { } $response = new AjaxResponse(); $response->addCommand(new CloseDialogCommand()); - $response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), !empty($selected_bundles) ? $this->t("
Selected: %bundles
", ['%bundles' => implode(', ', $selected_bundles)]) : '')); + $response->addCommand(new HtmlCommand('#selected-' . $this->entityType->id(), !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'))); return $response; } diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index adc3005..ff3d5f2 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -335,7 +335,7 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta ]; $form['entity_types_container'] = [ '#type' => 'details', - '#title' => $this->t('Applies to:'), + '#title' => $this->t('This workflow applies to:'), '#open' => TRUE, ]; $form['entity_types_container']['entity_types'] = [ @@ -359,18 +359,19 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta $form['entity_types_container']['entity_types'][$entity_type->id()] = [ 'type' => [ - 'label' => ['#markup' => $this->t('%bundle types', ['%bundle' => $entity_type->getLabel()])], + 'label' => ['#markup' => '' . $this->t('%bundle types', ['%bundle' => $entity_type->getLabel()]) . ''], 'selected' => [ - '#prefix' => '', - '#markup' => !empty($selected_bundles) ? $this->t("
Selected: %bundles
", ['%bundles' => implode(', ', $selected_bundles)]) : ''], - '#suffix' => '
', + '#prefix' => '
', + '#markup' => !empty($selected_bundles) ? implode(', ', $selected_bundles) : $this->t('none'), + '#suffix' => '', + ], ], 'operations' => [ '#type' => 'operations', '#links' => [ 'Add' => [ 'title' => $this->t('Select'), - 'url' => Url::fromRoute('workflow.update_entity_type_form', ['workflow' => $workflow->id(), 'entity_type_id' => $entity_type->id()]), + 'url' => Url::fromRoute('workflow.type_edit_form', ['workflow' => $workflow->id(), 'entity_type_id' => $entity_type->id()]), 'attributes' => [ 'aria-label' => $this->t('Select'), 'class' => ['use-ajax'],