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
| Comment | File | Size | Author |
|---|---|---|---|
| fix-unexpected-on-translation-with-duplicating-content.patch | 1001 bytes | benferch |
Issue fork pagedesigner-3380314
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
Comment #4
pvbergen commentedComment #6
pvbergen commentedComment #7
pvbergen commented