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

Fix redirection when there is a trailing slash in the products list path #11850

Merged

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Sep 16, 2020

Q A
Branch? 1.7
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Related tickets
License MIT

@loic425 loic425 requested a review from a team as a code owner September 16, 2020 13:07
@probot-autolabeler probot-autolabeler bot added the Shop ShopBundle related issues and PRs. label Sep 16, 2020
@loic425 loic425 changed the base branch from master to 1.7 September 16, 2020 13:07
@vvasiloi
Copy link
Contributor

Isn't that something Symfony already does https://symfony.com/doc/current/routing.html#redirecting-urls-with-trailing-slashes?

@loic425
Copy link
Member Author

loic425 commented Sep 16, 2020

Isn't that something Symfony already does https://symfony.com/doc/current/routing.html#redirecting-urls-with-trailing-slashes?

Yes, indeed and this is what I use to fix the problem.
But the slug is wrong with the trailing slash.

https://demo.sylius.com/en_US/taxons/caps/with-pompons/
In this example, $slug equals to "taxons/caps/with-pompons/" instead of "taxons/caps/with-pompons" => 404

With my change, the slug is now fixed and Symfony makes a redirection without the trailing slash.

@stale
Copy link

stale bot commented Dec 25, 2020

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in a week if no further activity occurs. Thank you for your contributions.

@stale stale bot added the Stale Issues and PRs with no recent activity, about to be closed soon. label Dec 25, 2020
Copy link
Member

@Zales0123 Zales0123 left a comment

Choose a reason for hiding this comment

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

I believe it's still a valid fix 👍 Just should be rebased with 1.8

@stale stale bot removed the Stale Issues and PRs with no recent activity, about to be closed soon. label Dec 29, 2020
@loic425 loic425 force-pushed the fix/trailing-slash-in-product-list-path branch from 585aecb to f44855a Compare December 29, 2020 12:29
@probot-autolabeler probot-autolabeler bot added the Maintenance CI configurations, READMEs, releases, etc. label Dec 29, 2020
@loic425 loic425 changed the base branch from 1.7 to 1.8 December 29, 2020 12:30
@loic425
Copy link
Member Author

loic425 commented Dec 29, 2020

I believe it's still a valid fix 👍 Just should be rebased with 1.8

@Zales0123 done 👍

src/Sylius/Behat/Context/Ui/Shop/ProductContext.php Outdated Show resolved Hide resolved
src/Sylius/Behat/Context/Ui/Shop/ProductContext.php Outdated Show resolved Hide resolved
@lchrusciel lchrusciel changed the base branch from 1.8 to 1.10 March 16, 2022 09:35
@lchrusciel lchrusciel changed the base branch from 1.10 to 1.8 March 16, 2022 09:35
@lchrusciel
Copy link
Member

Hey Loic,

could you rebase it to 1.10? Would be awesome to have it merged

@loic425 loic425 force-pushed the fix/trailing-slash-in-product-list-path branch from efa087f to bf48c38 Compare March 22, 2022 11:19
@loic425 loic425 changed the base branch from 1.8 to 1.10 March 22, 2022 11:19
@loic425
Copy link
Member Author

loic425 commented Mar 22, 2022

Hey Loic,

could you rebase it to 1.10? Would be awesome to have it merged

done

@loic425
Copy link
Member Author

loic425 commented Mar 25, 2022

@lchrusciel I think you could merge ;)

And the store has a product "Plastic Tomato" available in "Poland" channel
And this product belongs to "Funny"

@ui
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
@ui
@ui @no-api

but TBH, I would prefer to do just simple PHPUnit test for that instead of behat

@lchrusciel lchrusciel added the Bug Confirmed bugs or bugfixes. label Mar 25, 2022
@lchrusciel lchrusciel merged commit 4ed2d69 into Sylius:1.10 Mar 25, 2022
@lchrusciel
Copy link
Member

Thank you, Loïc! 🎉

@loic425 loic425 deleted the fix/trailing-slash-in-product-list-path branch March 26, 2022 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Confirmed bugs or bugfixes. Maintenance CI configurations, READMEs, releases, etc. Shop ShopBundle related issues and PRs.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants