Skip to content
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

Open
wants to merge 6 commits into
base: 4.6
Choose a base branch
from

Conversation

vidarl
Copy link
Contributor

@vidarl vidarl commented Oct 17, 2024

Question Answer
JIRA issue IBX-6312
Type bug
Target Ibexa version v3.3
BC breaks yes

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:
image

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:
image

In dev, the preview controller will throw a BadState exception and look like this:
image

For QA:

See instructions in ticket for how to reproduce

Documentation:

No doc needed

@vidarl vidarl changed the base branch from main to 4.6 October 17, 2024 11:42
@vidarl vidarl changed the title IBX-6312 IBX-6312: View matcher ParentContentType should not throw execption if parent is not available Oct 17, 2024
@vidarl vidarl force-pushed the ibx-6312_view_matcher_ParentContentType_when_parent_is_not_available_4.6 branch from b0c081d to 64aedb4 Compare October 17, 2024 12:51
@vidarl vidarl requested review from a team and alongosz October 17, 2024 12:57
@vidarl vidarl changed the title IBX-6312: View matcher ParentContentType should not throw execption if parent is not available IBX-6312: View matcher ParentContentType should not throw exception if parent is not available Oct 17, 2024
$this->controllerChecker
$this->controllerChecker,
false,
null
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Steveb-p : Added test in e3a7e61

@tomaszszopinski tomaszszopinski force-pushed the ibx-6312_view_matcher_ParentContentType_when_parent_is_not_available_4.6 branch from 9bd5144 to 3d8c612 Compare November 15, 2024 09:29
Copy link

@tomaszszopinski tomaszszopinski left a 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.

@tomaszszopinski
Copy link

🟢 ibexa/experience#509

@vidarl vidarl force-pushed the ibx-6312_view_matcher_ParentContentType_when_parent_is_not_available_4.6 branch from 3d8c612 to f7437ad Compare November 18, 2024 13:44
Copy link

sonarcloud bot commented Nov 18, 2024

@alongosz alongosz changed the title IBX-6312: View matcher ParentContentType should not throw exception if parent is not available IBX-6312: Fixed ParentContentType View Matcher for not available parent Nov 18, 2024
Comment on lines +11318 to +11322
-
message: "#^Cannot call method warning\\(\\) on Psr\\\\Log\\\\LoggerInterface\\|null\\.$#"
count: 3
path: src/lib/MVC/Symfony/Controller/Content/PreviewController.php

Copy link
Member

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.

@adamwojs
Copy link
Member

@vidarl Could you please rebase PR? CI has been fixed on base branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants