Bug #91196

Exception for FileUpload field in multi-step forms

Added by Sebastian Klein over 1 year ago. Updated 4 months ago.

Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Form Framework
Target version:
-
Start date:
2020-04-25
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:

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

fail.png (480 KB) fail.png Oliver Hader, 2020-05-06 16:18

Related issues

Related to TYPO3 Core - Bug #91364: Extbase/CachingFramework - Serialization on 'Closure' is not allowedNeeds Feedback2020-05-12

Actions
Related to TYPO3 Core - Bug #91398: Serialization of ObjectManager is brokenClosedBenjamin Franzke2020-05-14

Actions
#1

Updated by Marc Hauschildt over 1 year 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.

#2

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Accepted
#3

Updated by Oliver Hader over 1 year ago

Since everything is serialized - which is "suboptimal" - also closures in EventDispatcher are used...

#4

Updated by Oliver Hader over 1 year ago

Thus, basically state-handling is the big problem here... trying to preserve memory state "as-is" does not work in most cases...

#8

Updated by Oliver Hader over 1 year ago

  • Related to Bug #91364: Extbase/CachingFramework - Serialization on 'Closure' is not allowed added
#9

Updated by Oliver Hader over 1 year ago

  • Related to Bug #91398: Serialization of ObjectManager is broken added
#10

Updated by Oliver Hader over 1 year ago

  • Is Regression set to Yes
#11

Updated by Michael Voehringer over 1 year 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.

#12

Updated by Manuel Schnabel over 1 year 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.

#13

Updated by Marc Hauschildt over 1 year 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.

#14

Updated by Gerrit Code Review over 1 year 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

#15

Updated by Gerrit Code Review over 1 year 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

#16

Updated by Gerrit Code Review over 1 year 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

#17

Updated by Gerrit Code Review over 1 year 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

#18

Updated by Gerrit Code Review over 1 year 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

#19

Updated by Gerrit Code Review about 1 year 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

#20

Updated by Benjamin Franzke about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#21

Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed
#22

Updated by Gerrit Code Review 7 months 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

#23

Updated by Benjamin Franzke 7 months ago

  • Status changed from Under Review to Resolved
#24

Updated by Benni Mack 4 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF