Problem/Motivation
Our test suit picked up that it is impossible to submit a form without JavaScript with Drupal 9.5. Specifically it was tested with Drupal 9.5.2 , Media bulk upload 3.0.0 and PHP 8.0.
Tests are Behat driven and running using Goutte. Passing with no issues on Drupal 9.4.10.
Steps to reproduce
Manual
- create a "Document" upload configuration that will accept "Document" media with "Default" form
- navigate to the form
- disable JavaScript in your browser
- attach a single file
- click "Save"
- observe "Exception: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in serialize() (line 89 of core/lib/Drupal/Core/Queue/DatabaseQueue.php)."
Behat:
@api
Feature: "Content Manager" CMS role
In order to confirm platform configuration
As a "Content Manager"
I need to verify expected functionality
Scenario: Upload media document via bulk upload interface
Given I am logged in as a user with the "administer media_bulk_upload configuration" permission
And I am on "/admin/config/media/media-bulk-config/add"
And I fill in "Label" with "Document"
And I fill in "Machine-readable name" with "document"
And I fill in "Upload location" with "temp://bulk_upload/document/"
And I check the box "Document"
And I select "Default" from "Form Mode"
And I press "Save"
And the cache has been cleared
Given I am logged in as a user with the "use document bulk upload form" permission
When I am on "/media/bulk-upload"
Then I am at "/media/bulk-upload/document"
And I attach the file "documents/test.docx" to "File Upload"
And I press "Submit"
Then the following "document" media exist:
| name |
| test.docx |
The website encountered an unexpected error. Please try again later.<br><br><em class="placeholder">Exception</em>: Serialization of 'Symfony\Component\HttpFoundation\File\UploadedFile' is not allowed in <em class="placeholder">serialize()</em> (line <em class="placeholder">89</em> of <em class="placeholder">core/lib/Drupal/Core/Queue/DatabaseQueue.php</em>). <pre class="backtrace">Drupal\Core\Queue\DatabaseQueue->doCreateItem(Array) (Line: 68)
Drupal\Core\Queue\DatabaseQueue->createItem(Array) (Line: 1001)
_batch_populate_queue(Array, 0) (Line: 907)
batch_process() (Line: 63)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 595)
Drupal\Core\Form\FormBuilder->processForm('media_bulk_upload_form', Array, Object) (Line: 323)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 580)
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: 169)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 81)
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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 168)
Drupal\purge_queuer_url\StackMiddleware\UrlRegistrar->handle(Object, 1, 1) (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 134)
Drupal\cloudflare\CloudFlareMiddleware->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 713)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
</pre>
Proposed resolution
Remaining tasks
User interface changes
API changes
Data model changes