File tree 2 files changed +9
-6
lines changed
eZ/Publish/Core/Repository
tests/integration/Core/Repository/ContentService
2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -1295,7 +1295,7 @@ protected function internalUpdateContent(
1295
1295
APIVersionInfo $ versionInfo ,
1296
1296
APIContentUpdateStruct $ contentUpdateStruct ,
1297
1297
?array $ fieldIdentifiersToValidate = null ,
1298
- bool $ doAddEmpty = false
1298
+ bool $ copyEmptyField = false
1299
1299
): Content {
1300
1300
$ contentUpdateStruct = clone $ contentUpdateStruct ;
1301
1301
@@ -1386,7 +1386,7 @@ protected function internalUpdateContent(
1386
1386
);
1387
1387
$ fieldValues [$ fieldDefinition ->identifier ][$ languageCode ] = $ fieldValue ;
1388
1388
1389
- if ($ isRetained || $ isCopied || ($ isLanguageNew && $ isEmpty && !$ doAddEmpty ) || $ isProcessed ) {
1389
+ if ($ isRetained || $ isCopied || ($ isLanguageNew && $ isEmpty && !$ copyEmptyField ) || $ isProcessed ) {
1390
1390
continue ;
1391
1391
}
1392
1392
Original file line number Diff line number Diff line change 10
10
11
11
use DateTime ;
12
12
use eZ \Publish \API \Repository \Values \ContentType \FieldDefinitionCreateStruct ;
13
+ use eZ \Publish \Core \FieldType \TextLine ;
13
14
use eZ \Publish \Core \Repository \Values \Content \ContentUpdateStruct ;
14
15
use Ibexa \Tests \Integration \Core \RepositoryTestCase ;
15
16
@@ -67,11 +68,13 @@ public function testCopyTranslationsFromPublishedVersionCopiesEmptyValues(): voi
67
68
$ usContent = $ contentService ->updateContent ($ usDraft ->getVersionInfo (), $ contentUpdateStruct );
68
69
$ publishedUsContent = $ contentService ->publishVersion ($ usContent ->getVersionInfo (), [self ::US_LANGUAGE_CODE ]);
69
70
70
- $ gerFieldValueInUsContent = $ publishedUsContent ->getField ('title ' , self ::GER_LANGUAGE_CODE )
71
- -> getValue ()
72
- ->text ;
71
+ $ usFieldValueInUsContent = $ publishedUsContent ->getField ('title ' , self ::US_LANGUAGE_CODE )-> getValue ();
72
+ self :: assertInstanceOf ( TextLine \Value::class, $ usFieldValueInUsContent );
73
+ self :: assertSame ( '' , $ usFieldValueInUsContent ->text ) ;
73
74
74
- self ::assertSame ('' , $ gerFieldValueInUsContent );
75
+ $ gerFieldValueInUsContent = $ publishedUsContent ->getField ('title ' , self ::GER_LANGUAGE_CODE )->getValue ();
76
+ self ::assertInstanceOf (TextLine \Value::class, $ gerFieldValueInUsContent );
77
+ self ::assertSame ('' , $ gerFieldValueInUsContent ->text );
75
78
}
76
79
77
80
private function createContentType (): void
You can’t perform that action at this time.
0 commit comments