Problem/Motivation
This recent major task Support pending revisions and accepting translation as a specific moderation state introduced a logic to Review and Save the incoming Job Item / Translation matching as default the Source Translation Status: if it is Published the "Save and Accepted" would Default set the new Translation Moderation State to it, leaving the user able to modify/customise.
This choice is managed by the "#moderation_state" that is set in the job Item data to carry the information about the new moderation state value (see here).
The $data['#moderation_state'] is then used to set the proper moderation state for the Translation (see here).
At the moment, in case of Auto Accepted Job Items, the $data['#moderation_state'] is undefined so as also could be the $data['#published'], thus the Translations are automatically saved matching their original status, causing weird and un-expected outcomes in Basic and more Advanced use case, such for instance the following:
- if the Translation Source is Published but the Auto Accepted is not, then the new Accepted Translation is being save as Un-Published, and setting as Un-Published also the Translation Source, hence breaking the Auto Accept flow of subsequent incoming/remaining Languages Translations
Proposed resolution
In case of Auto Accepted Translation/$data['#moderation_state'] undefined, define it accordingly of the Moderation State of the Source Entity (if Moderated), so to let the Translation publication state being saved accordingly ...
| Comment | File | Size | Author |
|---|---|---|---|
| #10 | tmgmt_autoaccept_publication_logic_3212524_#10.patch | 995 bytes | itamair |
| #8 | tmgmt_autoaccept_publication_logic_3212524_#8.patch | 1.67 KB | itamair |
| #5 | tmgmt_autoaccept_publication_logic_3212524_#5.patch | 1.04 KB | itamair |
Comments
Comment #2
itamair commentedComment #3
itamair commentedComment #4
itamair commentedComment #5
itamair commentedThe attached patch rebuilds the code logic for setting the Auto Accepted Translation Publication status, accordingly to the Source Translation publication status.
Comment #6
itamair commentedComment #8
itamair commentedThis new patches adds also the settings of the source entity moderation state to the Accepted Translation (looks a more solid implementation for matching the required behaviour).
Comment #10
itamair commentedA better (and Tests better compliant) patch that just, if undefined, sets the $data['#moderation_state'] for matching the Source Entity Moderation State ...
Comment #11
itamair commentedComment #13
itamair commentedComment #14
marcusml commentedI think this behaviour is expected and not a bug. Looking at the discussions at #2978341: Support pending revisions and accepting translation as a specific moderation state you can read that automated workflows were not in the scope of that issue. I tested your patch it is seems to work as intended. But I think the behaviour needs to be configurable. I think there's already work put into this in #3193557: Add setting to set default moderation state. Maybe there's a patch there that you could try?
Comment #15
itamair commentedComment #16
itamair commentedthanks @marcusml ... I quickly checked the last patch in #3193557 and indeed embeds the capability to choose the Source Moderation State as the default one for the Translations being accepted, and it seems working.
I change this in a Feature Request that duplicates and could be accomplished streamlining that task/issue...