Translating pages and opting to duplicate content from master language results in errors

Created on 9 August 2023, about 1 year ago
Updated 24 October 2023, about 1 year ago

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

🐛 Bug report
Status

Fixed

Version

3.0

Component

Code

Created by

🇩🇪Germany benferch

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

Comments & Activities

Production build 0.71.5 2024