using tokens to pass paragraph values from fields in to webform does not work in 6.2 beta.

Created on 24 May 2023, over 1 year ago

Problem/Motivation

6.2 Beta breaks the use of [paragraph:...] tokens.

I have a node with a paragraph which lets you put a few fields in, and use a webform select reference field to pick a webform to use.

This does not work on 6.2 beta.

Rolling back to 6.1... and it does work.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Active

Version

6.2

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States alphex Atlanta, GA USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @alphex
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΎUruguay jjose.quevedo

    jjose.quevedo β†’ made their first commit to this issue’s fork.

  • πŸ‡ΊπŸ‡ΎUruguay jjose.quevedo

    Hi @jrockowitz,

    I've been attempting to reproduce the issue you mentioned, but found an error in the process. It's possible that I didn't replicate the issue accurately. Here are the steps I followed:

    1. Created a new paragraph.
    2. Added an email field to the paragraph.
    3. Created a webform.
    4. Added several fields to the webform.
    5. Created a custom content.
    6. Included the previously created paragraph as a field within the content.
    7. Added the webform as a field and tried to insert a token, as shown in your screenshot.

    However, I received the following error message:

    Default submission data (YAML) is using the following invalid tokens

    I'm wondering if I missed any steps or if there's something additional I need to do in order to reproduce the issue accurately.
    Any guidance or assistance you can provide would be greatly appreciated.

    Thank you!

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Default submission data (YAML) is using the following invalid tokens

    It is probably being triggered because the exact paragraph type and fields need to be created to replicate the issue. We might not be able to replicate the issue.

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY
  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    @alphex You could try using git bisect to determine which commit broke this functionality for you. That would help track down the problem.

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    I am not able to replicate this issue using the below steps

    • Import the attached webform
    • Enable the webform_test_paragraphs.module via `drush en -y webform_test_paragraphs`
    • Create a Webform Test Paragraphs node via /node/add/webform_test_paragraphs
    • Add the attached webform as a 'Webform test inline' paragraph
    • Use value: '[paragraph:id] | [paragraph:field_webform_test_value:value]' as the default data
    • Confirm the default data's [paragraph] token are replaced.

    Some thoughts to debug your current setup

    • Try a more straightforward token like [paragraph:id]
    • Maybe the entity reference chaining is not working as expected
  • Status changed to Postponed: needs info about 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    The only commit between 6.1.x and 6.2.x that impacts the Webform field is πŸ“Œ Add lazy builder support to the Webform render element. Fixed .

    The attached is "shoot-in-the-dark" patch that reverts 758963d272020a1260c6ac6d017510ca5ea11523

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    @alphex Please try the patch in #11 and let us know if it fixes the problem for you.

  • πŸ‡ΊπŸ‡ΈUnited States alphex Atlanta, GA USA

    I can confirm, the patch at #11 works for 6.2.x-dev

    Thank you!

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    Okay, let's see if we can replicate and fix the issue.

    Is lazy building enabled on the Webform field?

  • πŸ‡¨πŸ‡¦Canada Liam Morland Ontario, CA πŸ‡¨πŸ‡¦

    Per a discussion with @jrockowitz, this is not a release-blocker.

  • πŸ‡ΊπŸ‡ΈUnited States jrockowitz Brooklyn, NY

    At this point removing the lazy builder behavior is not an options. We need to replicate and fix the issue.

Production build 0.71.5 2024