Problem/Motivation

If you add a nested structure Paragraph >> ContentEntity >> IEF >> ContentEntity, the paragraph is not displayed correctly on the translation page.

Screencast: https://www.awesomescreenshot.com/video/23640588?key=9beecfed4a76078355c...

Steps to reproduce

Apply patch #8 from Show non-translatable fields instead of hiding them

Add Paragraphs type.
Add field "Text (plain)" (single value). Check "Users may translate this field".

Add vocabulary: check "Enable translation" in "Term language", save.
Add field "Reference revisions - Paragraph (unlimited)" to new paragraph type
Form widget "Paragraphs (stable)" with "Edit mode" = Closed.

Create content type: Click "Enable translation" in "Language settings", save.
Add field "Reference - Term (unlimited)" to new vocabulary. Check "Users may translate this field".
Form widget "Inline entity form - Complex".

On /admin/config/regional/content-language:
Check "Content" in "Custom language settings". In "Content" section check new paragraph type and check new text field.
Check "Paragraph" in "Custom language settings". In "Paragraph" section check new paragraph type.
Save.

Settings screenshots:

My investigation

On ajax call form is building OK.
The problem is in $form_state->getTriggeringElement(). It returns wrong element and wrong form part is returned in FormAjaxResponseBuilder.php:

// We need to return the part of the form (or some other content) that needs
// to be re-rendered so the browser can update the page with changed
// content. It is up to the #ajax['callback'] function of the element (may
// or may not be a button) that triggered the Ajax request to determine what
// needs to be rendered.
$callback = NULL;
if (($triggering_element = $form_state->getTriggeringElement()) && isset($triggering_element['#ajax']['callback'])) {
  $callback = $triggering_element['#ajax']['callback'];
}

Update 1:
If a paragraph translation has already been added, the issue goes away.

Update 2:
Collapse all and Edit all buttons works fine.

CommentFileSizeAuthor
Content.png25.2 KBsuper_romeo
Vocabulary.png21.81 KBsuper_romeo
Paragraph.png20.76 KBsuper_romeo

Issue fork 1491122-3411311

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Issue fork paragraphs-3411311

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

super_romeo created an issue. See original summary.

super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Title: The translation page does not correctly display paragraphs within the IEF » Collapsed paragraph cannot be opened within the IEF on a translation page
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Issue summary: View changes
super_romeo’s picture

Project: Inline Entity Form » Paragraph
Version: 3.0.0-rc17 »
super_romeo’s picture

Project: Paragraph » Paragraphs
Version: » 8.x-1.x-dev

super_romeo changed the visibility of the branch 3411311-Collapsed_paragraph_cannot_be_opened_within_the_IEF_on_a_translation_page to hidden.