Please sign in to comment.
Fix EZP-26449: Wrong version translation list in eZContentOperationCo…
…llection > https://jira.ez.no/browse/EZP-26449 When publishing a content from legacy (e.g. from admin interface), `content/publish` operation copies missing translations on the published version. However, `eZContentOperationCollection::copyTranslations()` ignores the version language mask when retrieving the translation list for the version to publish, using `$version->translationList( false, false )`. While this is usually fine as a translation is generally a full bunch of translated attributes, this can lead to unexpected behavior, especially when using a mix of legacy and platform scripts. Typical example is when using a _wait until date_ workflow (legacy admin/kernel), combined with several scripts from Symfony stack, like migration scripts for example: - Webmaster publishes from admin interface with a publication date set in the future. Content has several translations. - DevOps deliver a new version of code with migration scripts to update ContentTypes, including the one used by the webmaster, to add 1 new field - Workflow cronjob is run to publish content from webmaster The result here will be: - Translation published by the webmaster will be OK - All other translations will be broken, only having the new field. This is due to `$version->translationList( false, false )` used in `eZContentOperationCollection::copyTranslations`, called by the workflow cronjob. This method will list all available translations for given version, by calling a `SELECT DISTINCT language_code FROM ezcontentobject_attribute`. As we added a new field using the public API, all translations are taken into account, instead of only published language. Use `language_mask` from version instead of `$version->translationList()`.
- Loading branch information...
Showing with 5 additions and 5 deletions.