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

isamir created an issue. See original summary.

isamir’s picture

Issue summary: View changes
jrockowitz’s picture

Personally, 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.

jrockowitz’s picture

I 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.

  • jrockowitz committed c5eeeb0 on 2864741-webform-field-track-submission
    Issue #2864741: Webform fields used in Paragraphs do not track webform...

  • jrockowitz committed b2fb71d on 2864741-webform-field-track-submission
    Issue #2864741: Webform fields used in Paragraphs do not track webform...
isamir’s picture

Another 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

jrockowitz’s picture

Status: Active » Needs review
StatusFileSize
new10.38 KB
new106.01 KB

The 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.

jrockowitz’s picture

@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.

isamir’s picture

Wow, It works perfectly

Thanks Jacob, you are the man.

Can you add this patch to the dev version

isamir’s picture

Status: Needs review » Reviewed & tested by the community

  • jrockowitz committed 7039194 on 8.x-5.x
    Issue #2864741 by jrockowitz: Webform fields used in Paragraphs do not...
jrockowitz’s picture

Status: Reviewed & tested by the community » Fixed

Done!

jrockowitz’s picture

jrockowitz’s picture

Status: Fixed » Active
jrockowitz’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.