Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/lib/Base/Exceptions/ContentFieldValidationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ public static function createNewWithMultiline(array $errors, ?string $contentNam
$exception = new self($errors);
$exception->contentName = $contentName;

$exception->setMessageTemplate('Content "%contentName%" fields did not validate: %errors%');
$exception->setMessageTemplate('Content%contentName%fields did not validate: %errors%');
$exception->setParameters([
'%errors%' => $exception->generateValidationErrorsMessages(),
'%contentName%' => $exception->contentName !== null ? $exception->contentName : '',
'%contentName%' => $exception->contentName !== null ? ' "' . $exception->contentName . '" ' : ' ',
Comment thread
reithor marked this conversation as resolved.
Outdated
]);
$exception->message = $exception->getBaseTranslation();

Expand Down
2 changes: 1 addition & 1 deletion src/lib/Repository/ContentService.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public function createContent(APIContentCreateStruct $contentCreateStruct, array
);

if (!empty($errors)) {
throw new ContentFieldValidationException($errors);
throw ContentFieldValidationException::createNewWithMultiline($errors);
}

$spiLocationCreateStructs = $this->buildSPILocationCreateStructs(
Expand Down
Loading