Permalink
Browse files

Merge pull request #1265 from lolautruche/fix/cloneContentAttributes

Fix EZP-26449: Wrong version translation list in eZContentOperationCollection
  • Loading branch information...
2 parents 2dfb5cb + 97ffed4 commit aec3cac59657f750e8929c6f8c7dbbd850e9af2f @yannickroger yannickroger committed on GitHub Nov 14, 2016
Showing with 5 additions and 5 deletions.
  1. +5 −5 kernel/content/ezcontentoperationcollection.php
@@ -651,18 +651,18 @@ static public function copyTranslations( $objectID, $versionNum )
$publishedLanguageCodes = array_keys( $publishedLanguages );
$version = $object->version( $versionNum );
- $versionTranslationList = $version->translationList( false, false );
+ $versionTranslationList = array_keys( eZContentLanguage::languagesByMask( $version->attribute( 'language_mask' ) ) );
foreach ( $publishedVersionTranslations as $translation )
{
- if ( in_array( $translation->attribute( 'language_code' ), $versionTranslationList )
- || !in_array( $translation->attribute( 'language_code' ), $publishedLanguageCodes ) )
+ $translationLanguageCode = $translation->attribute( 'language_code' );
+ if ( in_array( $translationLanguageCode, $versionTranslationList )
+ || !in_array( $translationLanguageCode, $publishedLanguageCodes ) )
{
continue;
}
- $contentObjectAttributes = $translation->objectAttributes();
- foreach ( $contentObjectAttributes as $attribute )
+ foreach ( $translation->objectAttributes() as $attribute )
{
$clonedAttribute = $attribute->cloneContentObjectAttribute( $versionNum, $publishedVersionNum, $objectID );
$clonedAttribute->sync();

0 comments on commit aec3cac

Please sign in to comment.