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
[Bug]: Having a pretty URL, that matches the key of a document link leads to infinite redirects on multisite environments #16420
Comments
@alexej-d Thanks for reporting this issue. Does this also occur without subsites? |
@wisconaut yeah, the same error occurs without sites. If the resolved page of type link with the key test links to /subsite/subfolderOrPage/test an infinite loop is started. If /test just links to a direct URL or another document, the link is resolved but shouldn't be (calling /test should open /subsite/subfolderOrPage/test not the link in /test). |
@alexej-d Thanks for clarifying. We will have a look at it then. |
BTW @wisconaut: I believe this line needs to be changed. At the moment, it takes pretty URLs into account too late. Before matching by the system path (like now), the code needs to check if a document with the pretty URL exists first. |
@kingjia90 what I mean is that link documents should not be considered in the process of creating pretty URLs. Check the attached video. I should be able to create a correctly functioning pretty URL even if a document of the type link exists with the same key. Apart from that, I also think document folders and snippets are also considered when creating a pretty URL which is wrong as only page documents can have pretty URL… Bildschirmaufnahme.2024-02-26.um.13.48.51.mp4 |
Thank you for the videoscreenshot! I see, there is an alert on AFAIK it is/was always prioritizing the document full path over PrettyUrls here pimcore/models/Document/Dao.php Lines 62 to 70 in 2ad37be
|
@kingjia90 yeah, that alert should not have popped up as the duplicate URL is in fact just an internal path of a link document |
Link are not internal though, the right path is |
So my PR has been closed @kingjia90 – I take it you are working on this issue instead? :) |
Sorry for that, it was unintentional, as soon as i have deleted 11.1, it automatically closed all the open PRs based off that. Fixing these right now |
In your case, you have already deleted the branch though and i can't manually fix the base anymore, could you please recreate the branch and open a new PR? Thank you in advance |
@kingjia90 I have reopened my PR here #16776 |
Pimcore version
11.1.4
Steps to reproduce
Create a subsite. Create a link document with the key "test". Create a directory or a page and nest another page with the key "test" below it. Give the nested "test" document the pretty URL "/test".
Actual Behavior
I am caught in an infinite redirect loop.
Expected Behavior
Navigating to /test should show the page with the internal path /subsite/subfolderOrPage/test.
The text was updated successfully, but these errors were encountered: