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-4877: Allow Location-based Content preview #359

Merged
merged 4 commits into from
Feb 6, 2023

Conversation

barw4
Copy link
Member

@barw4 barw4 commented Jan 20, 2023

Question Answer
JIRA issue IBX-4877
Type improvement
Target Ibexa version v3.3
BC breaks no

As the title suggests. Using only main Location for preview would prevent certain users without access to main Location but with access to secondary Location from previewing such content.

Related PRs:

Checklist:

  • Provided PR description.
  • Tested the solution manually.
  • Provided automated test coverage.
  • Checked that target branch is set correctly (master for features, the oldest supported for bugs).
  • Ran PHP CS Fixer for new PHP code (use $ composer fix-cs).
  • Asked for a review (ping @ezsystems/engineering-team).

@barw4 barw4 added Improvement Changes not fixing or changing behavior Ready for review labels Jan 20, 2023
@barw4 barw4 requested a review from a team January 20, 2023 16:14
@barw4 barw4 self-assigned this Jan 20, 2023
@@ -7,7 +7,9 @@
{% endif %}
<title>{{ title|default( 'Home' ) }}</title>
<meta name="generator" content="Ibexa DXP"/>
{% if content is defined and content.contentInfo.mainLocationId %}
{% if content is defined and location is defined and location is not null and location.id is not null %}
Copy link
Contributor

Choose a reason for hiding this comment

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

is there really a possibility, that location.id is null?

Copy link
Member Author

@barw4 barw4 Feb 1, 2023

Choose a reason for hiding this comment

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

Yes, that can be a case, hence 24a5b01

Copy link
Member

@alongosz alongosz Feb 1, 2023

Choose a reason for hiding this comment

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

Yes, that can be a case, hence 24a5b01

@barw4 We need more explanation before we can proceed with this. When it can be null?

Copy link
Member Author

@barw4 barw4 Feb 1, 2023

Choose a reason for hiding this comment

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

@alongosz @ViniTou It is null by default, for example when one is creating a new LP anywhere and kernel gives us a preview, this is a standard behavior even without this PR:
image

This is a direct result of https://github.com/ezsystems/ezplatform-kernel/blob/1.3/eZ/Publish/Core/Helper/PreviewLocationProvider.php#L101-L109

@ViniTou ViniTou requested a review from a team February 1, 2023 08:22
@ciastektk ciastektk requested a review from a team February 1, 2023 08:41
@sonarcloud
Copy link

sonarcloud bot commented Feb 1, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@bogusez bogusez added the Ready for MERGE To be set by author or maintainer label Feb 6, 2023
@webhdx webhdx merged commit f2bc8ef into 1.3 Feb 6, 2023
@webhdx webhdx deleted the ibx-4877-content-preview-location-based branch February 6, 2023 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Changes not fixing or changing behavior QA approved Ready for MERGE To be set by author or maintainer