- π¬π§United Kingdom siliconandincense
I know this has been set as closed, but I am also getting this error by using the following steps:
1) I have a regular content type page that is already published
2) I set this page as draft and save it
3) I add a webform via a paragragraph, which has a webform reference field on it
4) I save the page
5) I view the page and get the same error as aboveI know this is a very personalised set of steps, but I'm hoping this may shed a little more light on the issue.
Can confirm #2 works, but as you say in #3 we get the submission message.
Apologese if this has been sorted in a subsequent ticket.
- π·π΄Romania mihai_brb
I got this error when the Webform reference field is attached to a Paragraph - that is attached to a Node.
Patch works. - Status changed to Active
over 2 years ago 1:16pm 27 April 2023 - Status changed to Needs work
about 2 years ago 2:35pm 27 May 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
The patch is most likely suppressing a larger issue with how the last submission is being determined.
We need to come up with simpler steps to reproduce the issue.
- Status changed to Closed: duplicate
about 2 years ago 1:16am 28 May 2023 - Status changed to Active
about 2 years ago 1:24am 28 May 2023 - πΊπΈUnited States jrockowitz Brooklyn, NY
I think #5 is catching that the issue has something to do with a webform embed via paragraph is not determining the correct source entity.
Paragraphs have become an ongoing challenge, and adjusting any of the existing logic without causing regressions is tough.
- πΊπΈUnited States gcb
I have the same issue, manifesting when I load up the layout builder configuration for a view mode for the entity.
- πΊπΈUnited States jrockowitz Brooklyn, NY
The proposed fix causes the switch/case to fall through to the next switch.
case WebformMessageManagerInterface::PREVIOUS_SUBMISSION: $webform_submission = $this->getSubmissionStorage()->getLastSubmission($webform, $source_entity, $this->currentUser); - $args = [':href' => $this->requestHandler->getUrl($webform_submission, $source_entity, 'webform.user.submission')->toString()]; - return $this->getCustomMessage('previous_submission_message', $args); + if ($webform_submission) { + $args = [':href' => $this->requestHandler->getUrl($webform_submission, $source_entity, 'webform.user.submission')->toString()]; + return $this->getCustomMessage('previous_submission_message', $args); + }
- π¦πΉAustria tgoeg
Hi!
I'm seeing this as well and I think I have a little more details that might help debugging:
It boils down to these two SQL queries (the self join seems irrelevant, but I'll leave it here as this is just how it got generated):
SELECT base_table.sid AS "sid", base_table.sid AS base_table_sid FROM webform_submission AS base_table INNER JOIN webform_submission AS webform_submission ON webform_submission.sid = base_table.sid WHERE (webform_submission.webform_id = "gutachten") AND (webform_submission.entity_type LIKE "node" ESCAPE '\\') AND (webform_submission.entity_id LIKE "45" ESCAPE '\\') AND (webform_submission.uid = "2") AND (webform_submission.in_draft = 0) ORDER BY base_table.sid DESC LIMIT 1 OFFSET 0 SELECT base_table.sid AS "sid", base_table.sid AS base_table_sid FROM webform_submission AS base_table INNER JOIN webform_submission AS webform_submission ON webform_submission.sid = base_table.sid WHERE (webform_submission.webform_id = "gutachten") AND (webform_submission.entity_type LIKE "paragraph" ESCAPE '\\') AND (webform_submission.entity_id LIKE "2" ESCAPE '\\') AND (webform_submission.uid = "2") AND (webform_submission.in_draft = 0) ORDER BY base_table.sid DESC LIMIT 1 OFFSET 0
The former one gives me my last submission, whereas the latter one yields NULL, which causes the HTTP 500.
In the first round
WebFormSubmissionForm->buildForm
uses
->displayMessages
,
WebFormSubmissionForm->sourceEntity
is "node" in this case.It then calls
->getLastSubmission
, finds a submission and wants to display the message. This is the first SQL query, it returns an entry.The
getMessageManager()
part then again uses the entity insetWebformSubmission()
(set, not get!), but this time the entity is "paragraph", and there are no submissions as this yields a NULL in the SQL query.I guess the problem is that the two calls should use the same entity ID, but I could not dig any deeper to find out why they don't.
Maybe this helps you to debug this further?These might be the steps to reproduce it:
I think you need to have submissions when using the webform as a block, then add it in a paragraph and load the page with the same user that has a submission from before.
"Show the notification about previous submissions" needs to be enabled for the form.
This seems to trigger the error.Another webform on the same page works flawlessly in a paragraph, so I think I can rule out paragraphs as the sole culprit. It seems to be the switch in where it is/was embedded and whether there are past submissions.
If I disable "Show the notification about previous submissions" in the config, the error is gone as well (pretty much expected). - π©πͺGermany hexabinaer Berlin, Germany
Manage display > Set submission source entity: No suppresses the fatal error, too. Just in case it helps digging.