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-4326: Custom URL aliases reparenting #355

Merged
merged 2 commits into from
Jan 5, 2023

Conversation

barw4
Copy link
Member

@barw4 barw4 commented Jan 2, 2023

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

Custom aliases were not reparented previously and simply were breaking when a parent was moved.

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 Bug Something isn't working Ready for review labels Jan 2, 2023
@barw4 barw4 requested a review from a team January 2, 2023 14:02
@barw4 barw4 self-assigned this Jan 2, 2023
Copy link
Member

@adamwojs adamwojs left a comment

Choose a reason for hiding this comment

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

Good one.

@konradoboza konradoboza requested a review from a team January 3, 2023 07:23
@mnocon
Copy link
Member

mnocon commented Jan 3, 2023

The tests are failing because of symfony/symfony#48832 , I've switched the selector to XPath in 2d04adf to make them green again

@sonarcloud
Copy link

sonarcloud bot commented Jan 3, 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 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@fancyweb
Copy link

fancyweb commented Jan 3, 2023

@mnocon The behavior of CSS abbr[title='$exceptionString'] to XPath has not changed in the latest symfony/css-selector release. Can you explain the problem plz?

@bogusez bogusez self-assigned this Jan 4, 2023
@mnocon
Copy link
Member

mnocon commented Jan 5, 2023

@fancyweb thank you for asking!

Our usage looks like this:
https://github.com/ezsystems/ezplatform-kernel/blob/1.3/eZ/Bundle/EzPublishCoreBundle/Features/Exception/unauthorized_login_form.feature#L10-L11

         Then an eZ\Publish\Core\Base\Exceptions\UnauthorizedException is displayed
          And an Symfony\Component\Security\Core\Exception\AccessDeniedException is displayed

and the Step definition is here:
https://github.com/ezsystems/ezplatform-kernel/blob/1.3/eZ/Bundle/EzPublishCoreBundle/Features/Context/ExceptionContext.php#L59-L65

    /**
     * @Then /^(?:a|an) ([\w\\]+Exception) is displayed$/
     */
    public function anAccessDeniedExceptionIsThrown($exceptionString)
    {
        $this->assertSession()->elementExists('css', "abbr[title='$exceptionString']");
    }

So the actual CSS selector looked like this:

abbr[title='eZ\Publish\Core\Base\Exceptions\UnauthorizedException']

When running it locally I got the Unfinished literal error mentioned in symfony/symfony#48832 - and the tests were passing until last week, which made me think we've hit the same issue related to backslash escaping.

In our case I've switched to XPath, which seems to handle it without issues.

Please let me know if there's anything else that you'd like me to add here.

@bogusez bogusez added QA approved Ready for MERGE To be set by author or maintainer and removed Ready for QA labels Jan 5, 2023
@mikadamczyk mikadamczyk merged commit 75fd942 into 1.3 Jan 5, 2023
@mikadamczyk mikadamczyk deleted the ibx-4326-custom-aliases-reparenting branch January 5, 2023 14:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working QA approved Ready for MERGE To be set by author or maintainer
Development

Successfully merging this pull request may close these issues.

10 participants