diff --git a/src/lib/Repository/ContentService.php b/src/lib/Repository/ContentService.php index 2cee84e93a..dbadbb2c8e 100644 --- a/src/lib/Repository/ContentService.php +++ b/src/lib/Repository/ContentService.php @@ -699,7 +699,7 @@ public function createContent(APIContentCreateStruct $contentCreateStruct, array ); if (!empty($errors)) { - throw new ContentFieldValidationException($errors); + throw ContentFieldValidationException::createNewWithMultiline($errors); } $spiLocationCreateStructs = $this->buildSPILocationCreateStructs( diff --git a/tests/lib/Repository/Service/Mock/ContentTest.php b/tests/lib/Repository/Service/Mock/ContentTest.php index 339d23b203..79b228e02a 100644 --- a/tests/lib/Repository/Service/Mock/ContentTest.php +++ b/tests/lib/Repository/Service/Mock/ContentTest.php @@ -2503,7 +2503,7 @@ public function providerForTestCreateContentThrowsContentFieldValidationExceptio public function testCreateContentThrowsContentFieldValidationException($mainLanguageCode, $structFields): void { $this->expectException(ContentFieldValidationException::class); - $this->expectExceptionMessage('Content fields did not validate'); + $this->expectExceptionMessage('Content "" fields did not validate'); $fieldDefinitions = $this->fixturesForTestCreateContentNonRedundantFieldSetComplex(); list($contentCreateStruct, $allFieldErrors) =