Hi,
while creating this issue I wasn't sure if it should be Bug report or Feature request. Anyhow,
I have added a webform field as a paragraphs field,
then I added this paragraph type to a content type.
The problem is:
when submitting the webform
The webform is submitted but the webform submissioins doesn't track the content type being submitted to
P.S. in webform (YML) result (entity_type: paragraph , entity_id: '3')
The reason why I'm adding webfrom as a paragraphs field is to allow content editors to attach any webform any number of times to the content and reorder the position of the webforms among other paragraphs.
Thanks for your help
Comments
Comment #2
isamir commentedComment #3
jrockowitz commentedPersonally, I think this is a regression and #2859351: Webform fields used in views do not track webform submissions and do not receive webform_submission tokens as default values is an edge case. I am just not sure how to best to address this issue.
Comment #4
jrockowitz commentedI think the solution would be the only consider something to be a source entity if it has canonical URL. This rule would exclude paragraphs and custom blocks from being source entities.
I am not actively using paragraphs but I think I can replicate the issue using a custom block with a webform field.
Comment #7
isamir commentedAnother things to mention,
when attaching webforms through block_field, the webform works just fine, and submissions tracking works as intended.
Also when using webform in paragraphs as mentioned in the issue and adding the same form as a field to the content type (i.e. a content type "A" has two fields 1- paragraph with webform , 2- webform field -- both use the same form ex. request form),
when submitting the paragraphs form, the submissions tracking is working good.
I don't know the explanation for this, but I guess the paragraphs form just triggers the field webform
Comment #8
jrockowitz commentedThe attached patch makes it possible to disable this behavior. See the below screenshot...
I am not 100% this is the best solution. Should this behavior be on or off by default?
BTW, I never expected the 'Webform' field type to be used so extensively and within Paragraphs. The good news is that it is working okay.
Comment #9
jrockowitz commented@isamir The Webform block and Webform field type are set up differently. Webform blocks always get the source entity from the current route. Webform fields are hardcoded to get the source entity from the field's (parent) entity.
Comment #10
isamir commentedWow, It works perfectly
Thanks Jacob, you are the man.
Can you add this patch to the dev version
Comment #11
isamir commentedComment #13
jrockowitz commentedDone!
Comment #14
jrockowitz commentedComment #15
jrockowitz commentedComment #16
jrockowitz commented