We've faced a courious behavoir with Paragraph link fields in ERL:

  1. Create a paragraph with an (optional) link field (maybe add another dummy text field or something to have any content for the later steps)
  2. Add a kint() to your link paragraphs twig file:
    {{ kint(paragraph.field_paragraphs_link.0) }}
  3. Add the paragraph to your ERL layout, leave the link field empty, fill your dummy text field and save the paragraph
  4. Save your node and return to the node edit
  5. Your kint should now show NULL
  6. Edit the paragraph, wait for the modal, close the modal
  7. Now the kint shows the link 'default object' (MOCK object), regular empty checks in the twig file will fail:

{% if paragraph.field_paragraphs_link.0 %}
This is now TRUE, you have to add:
{% if paragraph.field_paragraphs_link.0 and not paragraph.field_paragraphs_link.0.isEmpty() %}
to have a valid empty check again.

Why does this happen? and it there a way ERL could prevent this, so we can use regular twig empty checks again?

Attached: Screenshot of the kint before and after the AJAX edit.

Comments

thomas.frobieter created an issue.