-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IBX-6312: Fixed ParentContentType View Matcher for not available parent #438
IBX-6312: Fixed ParentContentType View Matcher for not available parent #438
Conversation
b0c081d
to
64aedb4
Compare
$this->controllerChecker | ||
$this->controllerChecker, | ||
false, | ||
null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: Ideally, logger calls should be checked (via Mock expectations). Missing log information would be an issue for a developer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
9bd5144
to
3d8c612
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QA approved on IbexaDXP 4.6 commerce.
3d8c612
to
f7437ad
Compare
phpstan-baseline.neon
Outdated
- | ||
message: "#^Cannot call method warning\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#" | ||
count: 3 | ||
path: src/lib/MVC/Symfony/Controller/Content/PreviewController.php | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an issue that needs to be resolved, not added to the baseline, please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alongosz : Adam said I could solve it this way : #438 (comment)
How to do you want it fixed then ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidarl ok, but then see #438 (comment) about how to handle expected "unresolvable" issues. Baseline is sort of "todo" list. On main we could tackle it with ?->
operator. Here we would need to use if
or ||
, so that might become unreadable indeed.
btw. for that reason I'm not a huge fan of traits, especially that one coming from PSR. They're meant to be very flexible which leads to such trivial issues.
But the solution could be as Steve described in the mentioned comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, I had missed @Steveb-p comment in #438 (comment)
Moved error to phpstan.neon.dist in ad68fc7
Better ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved error to phpstan.neon.dist in ad68fc7 Better ?
Almost 🙃
See: #438 (review)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidarl Could you please rebase PR? CI has been fixed on base branch. |
…f parent is not available
Co-authored-by: Paweł Niedzielski <[email protected]>
…ption if parent is not available - Added test of logging
f7437ad
to
b859f6f
Compare
04da2e5
to
ad68fc7
Compare
phpstan.neon.dist
Outdated
- | ||
message: "#^Cannot call method warning\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#" | ||
count: 3 | ||
path: src/lib/MVC/Symfony/Controller/Content/PreviewController.php |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vidarl Please notice the exact format of the mentioned example: https://github.com/ibexa/product-catalog/blob/main/phpstan.neon.dist#L18
For generic not resolvable issues we skip count and path in phpstan.neon
.
Co-authored-by: Konrad Oboza <[email protected]>
Quality Gate passedIssues Measures |
v3.3
This is a rebase of ezsystems/ezplatform-kernel#383 made for 3.3. But 3.3 is now out-of-maintenance
Description:
When matcher is checking parent's contenttype, it might throw NotFoundException if the parent is not available ( for instance if it is not available in any languages configured in the current siteaccess). I don't think the matcher should throw an exception in this case, just simply return false.
In dev, this NotFoundException will be shown to the user, while this will be handled by
Ibexa\Bundle\Core\EventListener\ExceptionListener
and a non-explaining 500 will be shown:The change have no functional change on the front-end site access. User will anyway be given a 404 ( but the NotFound exception is no longer originating from the matcher). However, in admin-ui there is a big difference. A Landing page is not editable in admin-ui without the fix because the preview will be rendered with the front-end siteaccess scope and the matcher will then throw the exception
With this fix, user will see this in prod:
In dev, the preview controller will throw a BadState exception and look like this:
For QA:
See instructions in ticket for how to reproduce
Documentation:
No doc needed