Problem/Motivation

When translating a page and selecting to duplicate content from the master language it results in an unexpected error. The cause of this is that in the "pagedesigner_duplication_custom_post_copy_content" method in the pagedesigner_duplication submodule tries retrieving the translation with $targetEntity = $targetEntity->getTranslation($language); without checking if one exists.

Steps to reproduce

  • Have a Drupal installation with multiple languages
  • Create a node in one language with pagedesigner elements
  • Create a translation of that node and select "Copy content from master language" checkbox

Proposed resolution

Check if the translation exists, if there is none add the translation.
See patch attached

Remaining tasks

User interface changes

API changes

Data model changes

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

benferch created an issue. See original summary.

pvbergen made their first commit to this issue’s fork.

pvbergen’s picture

Status: Active » Reviewed & tested by the community

pvbergen’s picture

Status: Reviewed & tested by the community » Fixed
pvbergen’s picture

Version: 2.0.1 » 3.x-dev

Status: Fixed » Closed (fixed)

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