Conversation
|
alongosz
left a comment
There was a problem hiding this comment.
The reason we didn't push for this change here and in the other places was BC concern. As you can see yourself, the matching pattern of a message slightly changes. It's likely that UI translations would require regenerating (there's no test for that due to technical challenges).
I'm not saying no. After all it's an improvement and BC concern touches mostly both 1st party (easy to check) and 3rd party E2E coverage.
However, what are the implications for the UI? Meaning how does this show up in the interface?
| { | ||
| $this->expectException(ContentFieldValidationException::class); | ||
| $this->expectExceptionMessage('Content fields did not validate'); | ||
| $this->expectExceptionMessage('Content "" fields did not validate'); |
There was a problem hiding this comment.
This is concerning. Is there no content name at this stage due to business logic or mocking?
Side note: this code is most likely a result of few automated refactoring. If you're touching this, both expectException and expectExceptionMessage should be moved right before the statement which produces the exception.
There was a problem hiding this comment.
However, what are the implications for the UI? Meaning how does this show up in the interface?
I don't think it is shown in the UI at all.
Error is thrown when creating content
# [src/lib/Repository/ContentService->createContent()
$errors = $this->validate(
$contentCreateStruct,
[],
$fieldIdentifiersToValidate
);
if (!empty($errors)) {
- throw new ContentFieldValidationException($errors);
+ throw ContentFieldValidationException::createNewWithMultiline($errors);
}
At this stage we only have $contentCreateStruct - nothing is persisted - we do not have a ContentName yet.
There was a problem hiding this comment.
But I see the BC concerns.



PR adds enhanced exception handling to
contentCreate(
ContentFieldValidationException::createNewWithMultiline($errors)was introduced in ezsystems/ezplatform-kernel#329)Without PR, thrown errors will show up as :
With PR, details regarding affected fields will be shown: