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-7364: Ensured independent property assignment in setPreviewActive method by using clone #323

Merged
merged 1 commit into from
Feb 12, 2024

Conversation

ViniTou
Copy link
Contributor

@ViniTou ViniTou commented Jan 24, 2024

Question Answer
JIRA issue IBX-7364
Type bug
Target Ibexa version v4.6
BC breaks yes/no

in \Ibexa\Core\MVC\Symfony\Controller\Content\PreviewController::previewContentAction when requesting preview for given siteaccess, that siteaccess then override original one (and everywhere else by reference) in \Ibexa\Bundle\Core\EventListener\SiteAccessListener::onSiteAccessMatch, as those are the same object - because of that, after doing request for preview in site-context, after that request we end up with wrong siteaccess for the rest of logic.

Cloning SA object when starting preview action solves reference issue, and still allowes for override default siteaccess with proper one at request initialization.

used in:
https://github.com/ibexa/site-context/pull/28

Checklist:

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

@alongosz
Copy link
Member

Fixed CI on main.

@ViniTou ViniTou force-pushed the ibx-7364-siteaccess-preview branch 2 times, most recently from da9df08 to 11e8f97 Compare January 25, 2024 08:27
@ViniTou ViniTou requested a review from a team January 29, 2024 09:24
@konradoboza konradoboza requested a review from a team January 29, 2024 09:25
@tomaszszopinski tomaszszopinski self-assigned this Feb 6, 2024
Copy link

sonarcloud bot commented Feb 6, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@mnocon mnocon left a comment

Choose a reason for hiding this comment

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

Tested together with https://github.com/ibexa/site-context/pull/41, looks good!

@alongosz alongosz merged commit 8f01648 into main Feb 12, 2024
21 checks passed
@alongosz alongosz deleted the ibx-7364-siteaccess-preview branch February 12, 2024 11:32
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.

7 participants