Closed (fixed)
Project:
Webform
Version:
6.1.x-dev
Component:
Code
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
23 Dec 2022 at 10:12 UTC
Updated:
25 Jan 2023 at 21:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
anas_maw commentedI'm having the same issue, once the webform includes select or other and a visible condition on this field.
Also I tried it on a fresh installation on fresh Drupal and the issue still exists
Comment #3
cilefen commentedComment #4
anas_maw commentedHere is a simple form for this issue:
Comment #5
WiseMike commentedThat's a great point! I checked on the site where the problem occurred. If I remove a visible condition from the file field, attaching files works without errors.
Also works if the form has select or other fields without a visible condition on the field file
Comment #6
dureaghin commentedI tested with Webform 6.1.2, same issue..
Drupal 9.5.0
PHP 8.1.13
MySQL 8.0.30
duplicateissues: https://www.drupal.org/project/webform/issues/3213580 and https://www.drupal.org/project/webform/issues/3240636Comment #7
cilefen commentedCan someone confirm that this is the core bug?
Comment #8
WiseMike commentedIt's not duplicate issue. Because before I updated Drupal to 9.5.0, the file upload fields worked fine through conditionnal logic, with no errors.
I did not install any new modules. Probably affected by an update of Drupal or some module. I can not confirm in detail, because I am not a programmer
Comment #9
anas_maw commentedThis issue is not related to the core bug, please import the form I attached in comment 4
I tried this form on a fresh Drupal installation, the issue happens when there is a webform handler and there is a 'select or other' element in the webform
Comment #10
ecvandenberg commentedI can confirm #9.
Removing the conditional view for the file upload field and also disable the e-mail handler solved the issue.
Both were required.
I wish I could debug more, but I'm no coder. I will donate in stead :-)
Comment #11
SlayJay commentedSame issue for me... Downgrading to Drupal 9.4.9 fixes the problem for me
Comment #12
cilefen commentedSome reporters are directly pointing to a Drupal Core bug and others insist it is not a Core bug.
Are there multiple causes (or even multiple bugs?) or do we need more tightly specified steps to reproduce?
Comment #13
vuilWe received the same error page (blank) after a webform submission with attached file/s on Drupal 9.5.0 & PHP 8.1:
We are already applied the mentioned in #6 Drupal core patch.
The
webform_attachmentis enabled.Is it possible someone to check with a disabled cache as it is already applied onto
views_bulk_editmodule here: #2974237: Serialization exception when trying to edit a file/image fieldComment #14
vuilComment #15
vuilDowngrade of
drupal/corefrom 9.5.0 to 9.4.9 makes our webforms with attachment files back to work for us too. The same as #11.Comment #16
jrockowitz commentedI cannot replicate this issue via Webform 6.2.x or 6.1.x and Drupal 9.5.1 using the attached webform based on #4, which had a dependency on the entity_redirect.module.
Please provide the elements and steps required to reproduce this issue.
Comment #17
jrockowitz commentedThe good news is the method that is throwing the error should be very easy to tweak not to serialize the object.
@see \Drupal\webform\Entity\WebformSubmission::getDataHash
Comment #18
jrockowitz commentedNow I see that you need to add a handler to replicate this bug.
Comment #19
jrockowitz commentedPlease take a look at the attached patch. Once this patch is reviewed, I will merge it and new beta releases.
Comment #20
alberto56 commentedI'll set this to "RTBC" based on the following:
(1) I have tested this and it fixes the issue on a production environment
(2) WebformSubmission::getDataHash() seems to only be used by WebformHandlerBase::checkConditions() to cache its results based on a form submission's field values.
With this patch, the hash will be identical regardless of the content of an object which is included in submission results. Specifically, any information included within the Symfony\Component\HttpFoundation\File\UploadedFile is not serialized and not part of the hash value.
I checked in handler's "condition" tab if such information can actually be used to determine the validity of a handler; and I have concluded that conditions do not seem to apply to file information contained in those objects (with the caveat that I don't use handler conditions in my production environments so I might not have considered all possibilities).
Therefore, the lack of object information within the serialized data used to generate the hash does not seem make it possible for two result sets (one for which handler conditions are valid and another for which they are invalid) to result in the same hash.
Comment #21
ecvandenberg commentedPatch #19 solves the issue in my config (drupal 9.5.0, webform 6.1.3, php 7.4.33)
Comment #22
jrockowitz commentedThis issue will impact all 6.x versions of the Webform module. I will commit the patch and tag new releases.
Comment #23
jrockowitz commented