Loading src/Controller/EntityQueueUIController.php +2 −1 Changes for src/Controller/EntityQueueUIController.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ class EntityQueueUIController extends ControllerBase { */ public function addForm(EntityQueueInterface $entity_queue) { $subqueue = $this->entityTypeManager()->getStorage('entity_subqueue')->create(['queue' => $entity_queue->id()]); return $this->entityFormBuilder()->getForm($subqueue); return $this->entityFormBuilder()->getForm($subqueue, 'add'); } /** Loading Loading @@ -273,4 +273,5 @@ class EntityQueueUIController extends ControllerBase { return AccessResult::forbidden(); } } src/Entity/EntitySubqueue.php +2 −1 Changes for src/Entity/EntitySubqueue.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,8 +34,9 @@ use Drupal\user\EntityOwnerTrait; * "storage" = "\Drupal\entityqueue\EntitySubqueueStorage", * "form" = { * "default" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "add" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "edit" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "delete" = "\Drupal\entityqueue\Form\EntitySubqueueDeleteForm", * "edit" = "Drupal\entityqueue\Form\EntitySubqueueForm" * }, * "access" = "Drupal\entityqueue\EntitySubqueueAccessControlHandler", * "route_provider" = { Loading src/EntityQueueListBuilder.php +2 −2 Changes for src/EntityQueueListBuilder.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -187,7 +187,6 @@ class EntityQueueListBuilder extends ConfigEntityListBuilder { protected function getQueueItemsStatus(EntityQueueInterface $queue) { $handler = $queue->getHandlerPlugin(); $items = NULL; if ($handler->supportsMultipleSubqueues()) { $subqueues_count = $this->entityTypeManager->getStorage('entity_subqueue')->getQuery() ->condition('queue', $queue->id(), '=') Loading @@ -198,8 +197,9 @@ class EntityQueueListBuilder extends ConfigEntityListBuilder { } else { $subqueue = EntitySubqueue::load($queue->id()); $count = $subqueue ? count($subqueue->items) : 0; $items = $this->formatPlural(count($subqueue->items), '@count item', '@count items'); $items = $this->formatPlural($count, '@count item', '@count items'); } return $items; Loading src/Form/EntityQueueForm.php +5 −0 Changes for src/Form/EntityQueueForm.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -81,9 +81,14 @@ class EntityQueueForm extends BundleEntityFormBase { $form = parent::form($form, $form_state); $queue = $this->entity; if ($this->operation === 'add') { $form['#title'] = $this->t('Add entity queue'); } else { $form['#title'] = $this->t('Configure <em>@queue</em> entity queue', [ '@queue' => $queue->label(), ]); } // Default to nodes as the queue target entity type. $target_entity_type_id = $queue->getTargetEntityTypeId() ?: 'node'; Loading src/Form/EntitySubqueueForm.php +5 −0 Changes for src/Form/EntitySubqueueForm.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,7 +70,12 @@ class EntitySubqueueForm extends ContentEntityForm { public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); if ($this->operation === 'add') { $form['#title'] = $this->t('Add subqueue'); } else { $form['#title'] = $this->t('Edit subqueue %label', ['%label' => $this->entity->label()]); } // Since the form has ajax buttons, the $wrapper_id will change each time // one of those buttons is clicked. Therefore the whole form has to be Loading Loading
src/Controller/EntityQueueUIController.php +2 −1 Changes for src/Controller/EntityQueueUIController.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -159,7 +159,7 @@ class EntityQueueUIController extends ControllerBase { */ public function addForm(EntityQueueInterface $entity_queue) { $subqueue = $this->entityTypeManager()->getStorage('entity_subqueue')->create(['queue' => $entity_queue->id()]); return $this->entityFormBuilder()->getForm($subqueue); return $this->entityFormBuilder()->getForm($subqueue, 'add'); } /** Loading Loading @@ -273,4 +273,5 @@ class EntityQueueUIController extends ControllerBase { return AccessResult::forbidden(); } }
src/Entity/EntitySubqueue.php +2 −1 Changes for src/Entity/EntitySubqueue.php: 2 added lines, 1 removed line. Original line number Diff line number Diff line Loading @@ -34,8 +34,9 @@ use Drupal\user\EntityOwnerTrait; * "storage" = "\Drupal\entityqueue\EntitySubqueueStorage", * "form" = { * "default" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "add" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "edit" = "Drupal\entityqueue\Form\EntitySubqueueForm", * "delete" = "\Drupal\entityqueue\Form\EntitySubqueueDeleteForm", * "edit" = "Drupal\entityqueue\Form\EntitySubqueueForm" * }, * "access" = "Drupal\entityqueue\EntitySubqueueAccessControlHandler", * "route_provider" = { Loading
src/EntityQueueListBuilder.php +2 −2 Changes for src/EntityQueueListBuilder.php: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -187,7 +187,6 @@ class EntityQueueListBuilder extends ConfigEntityListBuilder { protected function getQueueItemsStatus(EntityQueueInterface $queue) { $handler = $queue->getHandlerPlugin(); $items = NULL; if ($handler->supportsMultipleSubqueues()) { $subqueues_count = $this->entityTypeManager->getStorage('entity_subqueue')->getQuery() ->condition('queue', $queue->id(), '=') Loading @@ -198,8 +197,9 @@ class EntityQueueListBuilder extends ConfigEntityListBuilder { } else { $subqueue = EntitySubqueue::load($queue->id()); $count = $subqueue ? count($subqueue->items) : 0; $items = $this->formatPlural(count($subqueue->items), '@count item', '@count items'); $items = $this->formatPlural($count, '@count item', '@count items'); } return $items; Loading
src/Form/EntityQueueForm.php +5 −0 Changes for src/Form/EntityQueueForm.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -81,9 +81,14 @@ class EntityQueueForm extends BundleEntityFormBase { $form = parent::form($form, $form_state); $queue = $this->entity; if ($this->operation === 'add') { $form['#title'] = $this->t('Add entity queue'); } else { $form['#title'] = $this->t('Configure <em>@queue</em> entity queue', [ '@queue' => $queue->label(), ]); } // Default to nodes as the queue target entity type. $target_entity_type_id = $queue->getTargetEntityTypeId() ?: 'node'; Loading
src/Form/EntitySubqueueForm.php +5 −0 Changes for src/Form/EntitySubqueueForm.php: 5 added lines, 0 removed lines. Original line number Diff line number Diff line Loading @@ -70,7 +70,12 @@ class EntitySubqueueForm extends ContentEntityForm { public function form(array $form, FormStateInterface $form_state) { $form = parent::form($form, $form_state); if ($this->operation === 'add') { $form['#title'] = $this->t('Add subqueue'); } else { $form['#title'] = $this->t('Edit subqueue %label', ['%label' => $this->entity->label()]); } // Since the form has ajax buttons, the $wrapper_id will change each time // one of those buttons is clicked. Therefore the whole form has to be Loading