Undefined array key "add_more" in Drupal\entityqueue\Plugin\Field\FieldWidget\EntityqueueDragtableWidget::addItemAjax()

Created on 21 September 2023, over 1 year ago
Updated 22 September 2023, over 1 year ago

Problem/Motivation

When trying to add a entityqueue item to the last position on a limited entity queue, the following php warnings are triggered:

Warning: Undefined array key "add_more" in Drupal\entityqueue\Plugin\Field\FieldWidget\EntityqueueDragtableWidget::addItemAjax() (line 339 of /var/www/html/web/modules/contrib/entityqueue/src/Plugin/Field/FieldWidget/EntityqueueDragtableWidget.php)

Warning: Trying to access array offset on value of type null in Drupal\entityqueue\Plugin\Field\FieldWidget\EntityqueueDragtableWidget::addItemAjax() (line 339 of /var/www/html/web/modules/contrib/entityqueue/src/Plugin/Field/FieldWidget/EntityqueueDragtableWidget.php)

Steps to reproduce

Add a limited entityqueue and set all items, at the last position the warnings are triggered.

Proposed resolution

Check that 'add_more' element is set.

🐛 Bug report
Status

Fixed

Version

1.0

Component

Code

Created by

🇵🇹Portugal joao.ramos.costa

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024