Bug #91196
closedException for FileUpload field in multi-step forms
100%
Description
This issue occurs in TYPO3 10.4.0:
If you configure a multi-step form (with second 'Step' or 'Summary step') and add a field of type FileUpload
, the following PHP exception occurs when you call the next step:
(1/1) Exception Serialization of 'Closure' is not allowed typo3_src-10.4.0/typo3/sysext/form/Classes/ViewHelpers/FormViewHelper.php line 49 49 $serializedFormState = base64_encode(serialize($this->arguments['object']->getFormState()));
If your form only has one page/step, the file upload works as expected.
Files
Updated by Marc Hauschildt almost 5 years ago
I guess its a problem with the serialialisation.
The issue not only occurs in multi-step forms but every time TYPO3\CMS\Extbase\Domain\Model\FileReference should serialized.
This also happens when you submit a form step by using an upload field and the step contains errors elsewhere.
Short: If FormState array contains an object of TYPO3\CMS\Extbase\Domain\Model\FileReference serialize not working.
Updated by Oliver Hader almost 5 years ago
Since everything is serialized - which is "suboptimal" - also closures in EventDispatcher are used...
Updated by Oliver Hader almost 5 years ago
Thus, basically state-handling is the big problem here... trying to preserve memory state "as-is" does not work in most cases...
Updated by Oliver Hader almost 5 years ago
- Related to Bug #91364: Extbase/CachingFramework - Serialization on 'Closure' is not allowed added
Updated by Oliver Hader almost 5 years ago
- Related to Bug #91398: Serialization of ObjectManager is broken added
Updated by Michael Voehringer almost 5 years ago
- Priority changed from Should have to Must have
Is someone having a patch for this problem or can I help solving it?
At the moment this bug makes it impossible for us to use the form with file fields.
Updated by Manuel Schnabel almost 5 years ago
I also found the same problem with custom validators and integrated a workaround by overwriting and expanding the FormViewHelper
In this case, I only have overwritten the formstate arguments of the corresponding file upload with the identifier of the file. I inserted everything into the FormViewHelper before serialization (line 49).
It's certainly not the best solution, but at least I can use the forms temporarily until the problem is fixed.
Updated by Marc Hauschildt almost 5 years ago
Manuel Schnabel wrote:
I also found the same problem with custom validators and integrated a workaround by overwriting and expanding the FormViewHelper
In this case, I only have overwritten the formstate arguments of the corresponding file upload with the identifier of the file. I inserted everything into the FormViewHelper before serialization (line 49).
It's certainly not the best solution, but at least I can use the forms temporarily until the problem is fixed.
Fixed it the same way. Works for me as well as a temporary solution.
Updated by Gerrit Code Review almost 5 years ago
- Status changed from Accepted to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64838
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64839
Updated by Gerrit Code Review almost 5 years ago
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64841
Updated by Gerrit Code Review almost 5 years ago
Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64841
Updated by Gerrit Code Review almost 5 years ago
Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64841
Updated by Gerrit Code Review over 4 years ago
Patch set 1 for branch 10.4 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/64975
Updated by Benjamin Franzke over 4 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset 65be85b110833d7eb56a87a6544b4d6b53ab33fc.
Updated by Gerrit Code Review about 4 years ago
- Status changed from Closed to Under Review
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/68341
Updated by Benjamin Franzke about 4 years ago
- Status changed from Under Review to Resolved
Applied in changeset 6715ff9279bdc8bb18ab6c8fe25c0a30143ada37.
Updated by Benni Mack almost 4 years ago
- Status changed from Resolved to Closed
Updated by Nikolas Hagelstein over 3 years ago
Benjamin Franzke wrote in #note-23:
Applied in changeset 6715ff9279bdc8bb18ab6c8fe25c0a30143ada37.
Not sure if this is the right place but: In TYPO3 11V. Serialisation of FAL (File e.g.) is not possible. Due the fact the files Storage is holding and EventDispatcher which is holding closures ;(.