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

Created on 9 August 2023, 11 months ago
Updated 24 October 2023, 8 months 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.69.0 2024