Closed (fixed)
Project:
Webform
Version:
8.x-5.x-dev
Component:
Code
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
19 Sep 2018 at 17:01 UTC
Updated:
3 Nov 2018 at 10:19 UTC
Jump to comment: Most recent, Most recent file

Comments
Comment #2
john cook commentedI've created a patch to traverse the entity tree until a non-paragraph entity is found and use that as the source entity.
The result is shown below:
Comment #3
john cook commentedComment #4
jrockowitz commentedDid you try to uncheck "Use this field's Content entity as the webform submission's source entity."?
I know this setting is hidden but I think it solves your problem.
Comment #5
jrockowitz commentedComment #6
john cook commented@jrockowitz
Thanks, unchecking the checkbox works when viewing the node's page. But if viewing the node using other methods (views for example) there isn't an entity from the URL that can be set.
Having the checkbox checked and applying the patch in #2 allows the node to be set, even when using views to show the nodes. I think this would be the required behaviour.
On the other hand, the description text says:
If the patch in #2 is to be used, then an exception for this text needs to be created as well.
Comment #8
jrockowitz commented@John Cook I am 100% onboard with this patch.
Can you please update the description text to use the paragraph's parent source entity?
You could add a WebformEntityReferenceEntityFormatter::getSourceEntity() helper method.
Finally, there needs to be a very brief change record since the expected behavior is changing?
Comment #10
jrockowitz commentedThe patch from #3001446: Access denied message is not being displayed updated WebformEntityReferenceEntityFormatter::viewElements so I re-rolled this patch. I also changed the WebformEntityReferenceEntityFormatter::settingsForm title and description to use the below text.
I am not sure how to address Webform fields that are displayed as links. Still, this patch is already addressing a major problem with paragraphs integration.
Comment #11
jrockowitz commentedI committed the patch.
We can resolve how to handle a webform field displayed as a link within a paragraph in a new ticket.
Comment #13
jrockowitz commentedWow! I completely failed to apply this patch.
Comment #14
jrockowitz commentedComment #16
jrockowitz commentedComment #18
jrockowitz commentedBTW, I did figure out how to handle a webform field displayed as a link within a paragraph.