- Issue created by @EthanT
- πΊπΈUnited States glynster
This patch is super important using Drupal 10.1.1. Without it the form will fail to save.
This was not occurring on Drupal 9.5.
RTBC +1
- Status changed to RTBC
about 1 year ago 12:49am 26 August 2023 - πΊπΈUnited States Chris Matthews
inputbag-nonscalar-value.patch β works for me on Drupal 10.1.2. Since it's relatively simple I'm taking the liberty to set as RTBC.
- πΊπΈUnited States bkosborne New Jersey, USA
Can anyone explain why this patch fixes the problem? Is bulk_upload_ids not part of the query string in Drupal 10.1 when using the form for some reason?
- Status changed to Postponed: needs info
about 1 year ago 9:52pm 28 August 2023 - πΊπΈUnited States Chris Matthews
I removed the patch, manually tested again, and now I cannot reproduce the error so no idea what was going on. π€·π»
- πΊπΈUnited States glynster
Drupal 10.1.2 PHP 8.2.9 Simple Media Bulk Upload 1.0.1
Here are my steps to reproduce:
- /admin/content/media > Bulk upload
- drag and drop 2 x images (jpeg)
- Continue
- First image form (/media/240/edit?bulk_upload_ids%5B0%5D=241), then save
Then the follow error and url:
- media/240/edit?bulk_upload_ids%5B0%5D=241
InvalidArgumentException: Expected a scalar value as a 2nd argument to "Symfony\Component\HttpFoundation\InputBag::get()", "array" given. in Symfony\Component\HttpFoundation\InputBag->get() (line 31 of /var/www/html/vendor/symfony/http-foundation/InputBag.php).
Regardless both images saved.
Performing the exact same procesdure with the patch enables the second image for to show and adjust/save as image 1.
Hope this helps!
- Status changed to RTBC
about 1 year ago 7:37pm 3 October 2023 - heddn Nicaragua
Closed π InputBag::get(), no longer accepts arrays as default values, so we need to change it to string. Closed: duplicate as duplicate.
- πΊπΈUnited States bkosborne New Jersey, USA
Okay, I see why this is happening now. Symfony 6 no longer allows you to retrieve a non-scalar value from the InputBag. If you're trying to get an array value from there, you have to use the ->all() method. Will review this once more, commit and put out a release.
- Status changed to Fixed
about 1 year ago 7:35pm 9 October 2023 - πΊπΈUnited States bkosborne New Jersey, USA
Modified the patch slightly to reduce some redundancy above. Tested on Drupal 10.1.x and works well. Thanks all, and sorry for the delay.
-
bkosborne β
committed 03cb2ff5 on 1.0.x
Issue #3370657 by bkosborne, EthanT, glynster, Chris Matthews: Symfony\...
-
bkosborne β
committed 03cb2ff5 on 1.0.x
Automatically closed - issue fixed for 2 weeks with no activity.