Commit 3712a200 authored by Andrei Mateescu's avatar Andrei Mateescu
Browse files

Issue #3298778 by Ruslan Piskarov, tibezh: PHP 8.1 Deprecated function:...

Issue #3298778 by Ruslan Piskarov, tibezh: PHP 8.1 Deprecated function: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated
parent 46f85696
Loading
Loading
Loading
Loading
+2 −1
Changes for src/Controller/EntityQueueUIController.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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');
  }

  /**
@@ -273,4 +273,5 @@ class EntityQueueUIController extends ControllerBase {

    return AccessResult::forbidden();
  }

}
+2 −1
Changes for src/Entity/EntitySubqueue.php: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -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" = {
+2 −2
Changes for src/EntityQueueListBuilder.php: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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(), '=')
@@ -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;
+5 −0
Changes for src/Form/EntityQueueForm.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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';
+5 −0
Changes for src/Form/EntitySubqueueForm.php: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -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