Deleting submissions using webform_submission_bulk_form fails because row order is random

Created on 6 March 2024, 9 months ago
Updated 8 April 2024, 8 months ago

Problem/Motivation

On the submissions page (/admin/structure/webform/manage/webform_id/results/submissions), deleting submissions fails with the error

The submitted value <em class="placeholder">280</em> in the <em class="placeholder">items</em> element is not allowed.

Steps to reproduce

  1. Create a webform with many submissions, for example 1000.
  2. Use the customize button to move the “locked” column to the very left.
  3. Now, the error above appears every time I check a checkbox in front of a submission in the table, pick “Delete submission” from the select and press the “Apply to selected items” button.

The order of rows in the table has changed. I can also see this in the debugger, e.g. in \Drupal\Core\Form\FormValidator::performRequiredValidation, when I look at the keys of the $options variable before the $form_state->setError() call.

I am using MariaDB v11.0.2.

Proposed resolution

Add the sid as a second order column as a fallback.

Remaining tasks

Review patch or suggest a different resolution.

User interface changes

None.

API changes

None.

Data model changes

None.

🐛 Bug report
Status

Needs review

Version

6.2

Component

Code

Created by

🇩🇪Germany gogowitsch

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

Comments & Activities

  • Issue created by @gogowitsch
  • 🇩🇪Germany gogowitsch

    Here is a stack trace from the debugger:

    Drupal\Core\Form\FormErrorHandler->displayErrorMessages(Array, Object) (Line: 23)
    Drupal\Core\Form\FormErrorHandler->handleFormErrors(Array, Object) (Line: 199)
    Drupal\Core\Form\FormValidator->finalizeValidation(Array, Object, 'webform_submission_bulk_form') (Line: 119)
    Drupal\Core\Form\FormValidator->validateForm('webform_submission_bulk_form', Array, Object) (Line: 593)
    Drupal\Core\Form\FormBuilder->processForm('webform_submission_bulk_form', Array, Object) (Line: 325)
    Drupal\Core\Form\FormBuilder->buildForm('\Drupal\webform\Form\WebformSubmissionBulkForm', Object) (Line: 224)
    Drupal\Core\Form\FormBuilder->getForm('\Drupal\webform\Form\WebformSubmissionBulkForm', Array, 1) (Line: 577)
    Drupal\webform\WebformSubmissionListBuilder->buildEntityList() (Line: 462)
    Drupal\webform\WebformSubmissionListBuilder->render() (Line: 23)
    Drupal\Core\Entity\Controller\EntityListController->listing('webform_submission')
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 181)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
  • Status changed to Needs review 9 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 10.1.4 + Environment: PHP 8.2 & MySQL 8
    last update 9 months ago
    536 pass
  • 🇩🇪Germany gogowitsch

    I added a patch.

  • 🇺🇸United States jrockowitz Brooklyn, NY
Production build 0.71.5 2024