diff --git a/core/modules/content_moderation/content_moderation.module b/core/modules/content_moderation/content_moderation.module index 7161d21..7260eab 100644 --- a/core/modules/content_moderation/content_moderation.module +++ b/core/modules/content_moderation/content_moderation.module @@ -7,7 +7,6 @@ use Drupal\content_moderation\EntityOperations; use Drupal\content_moderation\EntityTypeInfo; -use Drupal\content_moderation\Form\WorkflowTypeEditForm; use Drupal\content_moderation\ContentPreprocess; use Drupal\content_moderation\Plugin\Action\ModerationOptOutPublishNode; use Drupal\content_moderation\Plugin\Action\ModerationOptOutUnpublishNode; diff --git a/core/modules/content_moderation/content_moderation.routing.yml b/core/modules/content_moderation/content_moderation.routing.yml index d86a439..41d2031 100644 --- a/core/modules/content_moderation/content_moderation.routing.yml +++ b/core/modules/content_moderation/content_moderation.routing.yml @@ -2,6 +2,6 @@ entity.workflow.edit_type_form: path: '/admin/config/workflow/workflows/manage/{workflow}/type/{entity_type}' defaults: _form: '\Drupal\content_moderation\Form\WorkflowTypeEditForm' - _title: 'Add / remove types' + _title: 'Add or remove types' requirements: _permission: 'administer workflows' diff --git a/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php b/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php index 10c2785..daeb053 100644 --- a/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php +++ b/core/modules/content_moderation/src/Form/WorkflowTypeEditForm.php @@ -101,7 +101,6 @@ public function buildForm(array $form, FormStateInterface $form_state, $workflow } } - if (!empty($options)) { $form['bundles'] = [ '#type' => 'tableselect', @@ -154,7 +153,7 @@ public function submitForm(array &$form, FormStateInterface $form_state) { * @return \Drupal\Core\Ajax\AjaxResponse * An ajax response object. */ - public function ajaxcallback() { + public function ajaxCallback() { $selected_bundles = []; foreach (\Drupal::service('entity_type.bundle.info')->getBundleInfo($this->entityType->id()) as $bundle_id => $bundle) { if ($this->workflow->getTypePlugin()->appliesToEntityTypeAndBundle($this->entityType->id(), $bundle_id)) { diff --git a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php index 43d2f02..5c57d4a 100644 --- a/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php +++ b/core/modules/content_moderation/src/Plugin/WorkflowType/ContentModeration.php @@ -372,10 +372,10 @@ public function buildConfigurationForm(array $form, FormStateInterface $form_sta '#type' => 'operations', '#links' => [ 'Add' => [ - 'title' => $this->t('Add / remove types'), + 'title' => $this->t('Add or remove types'), 'url' => Url::fromRoute('entity.workflow.edit_type_form', ['workflow' => $form_state->getBuildInfo()['callback_object']->getEntity()->id(), 'entity_type' => $entity_type->id()]), 'attributes' => [ - 'aria-label' => $this->t('Add / remove types'), + 'aria-label' => $this->t('Add or remove types'), 'class' => ['use-ajax'], 'data-dialog-type' => 'modal', 'data-dialog-options' => Json::encode([ diff --git a/core/modules/workflows/src/Form/WorkflowEditForm.php b/core/modules/workflows/src/Form/WorkflowEditForm.php index c5d088d..16cb299 100644 --- a/core/modules/workflows/src/Form/WorkflowEditForm.php +++ b/core/modules/workflows/src/Form/WorkflowEditForm.php @@ -189,8 +189,8 @@ public function form(array $form, FormStateInterface $form_state) { $form['type_settings'] = [ '#tree' => TRUE, ]; - $sub_form_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); - $form['type_settings'] += $workflow->getTypePlugin()->buildConfigurationForm($form['type_settings'], $sub_form_state); + $subform_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); + $form['type_settings'] += $workflow->getTypePlugin()->buildConfigurationForm($form['type_settings'], $subform_state); } return $form; @@ -203,8 +203,8 @@ public function validateForm(array &$form, FormStateInterface $form_state) { /* @var \Drupal\workflows\WorkflowInterface $workflow */ $workflow = $this->entity; if ($form_state->get('is_configurable')) { - $sub_form_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); - $workflow->getTypePlugin()->validateConfigurationForm($form['type_settings'], $sub_form_state); + $subform_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); + $workflow->getTypePlugin()->validateConfigurationForm($form['type_settings'], $subform_state); } } @@ -215,8 +215,8 @@ public function save(array $form, FormStateInterface $form_state) { /* @var \Drupal\workflows\WorkflowInterface $workflow */ $workflow = $this->entity; if ($form_state->get('is_configurable')) { - $sub_form_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); - $workflow->getTypePlugin()->submitConfigurationForm($form['type_settings'], $sub_form_state); + $subform_state = SubformState::createForSubform($form['type_settings'], $form, $form_state); + $workflow->getTypePlugin()->submitConfigurationForm($form['type_settings'], $subform_state); } $workflow->save();