Project

General

Profile

Actions

Bug #91196

closed

Exception for FileUpload field in multi-step forms

Added by Sebastian Klein about 4 years ago. Updated over 2 years 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 2 (1 open1 closed)

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

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

Actions
Actions #1

Updated by Marc Hauschildt about 4 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.

Actions #2

Updated by Oliver Hader about 4 years ago

  • Status changed from New to Accepted
Actions #3

Updated by Oliver Hader about 4 years ago

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

Actions #4

Updated by Oliver Hader about 4 years ago

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

Actions #8

Updated by Oliver Hader almost 4 years ago

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

Updated by Oliver Hader almost 4 years ago

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

Updated by Oliver Hader almost 4 years ago

  • Is Regression set to Yes
Actions #11

Updated by Michael Voehringer almost 4 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.

Actions #12

Updated by Manuel Schnabel almost 4 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.

Actions #13

Updated by Marc Hauschildt almost 4 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.

Actions #14

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

Actions #15

Updated by Gerrit Code Review almost 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/+/64839

Actions #16

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

Actions #17

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

Actions #18

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

Actions #19

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

Actions #20

Updated by Benjamin Franzke almost 4 years ago

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

Updated by Benni Mack over 3 years ago

  • Status changed from Resolved to Closed
Actions #22

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

Actions #23

Updated by Benjamin Franzke about 3 years ago

  • Status changed from Under Review to Resolved
Actions #24

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed
Actions #25

Updated by Nikolas Hagelstein over 2 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 ;(.

Actions

Also available in: Atom PDF