Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Return an url and not a path
At this moment we use
"/".join(obj.getPhysicalPath()
) to replace${navigation_root_url} and ${portal_url} in Link redirection indexer but with
production site (with reverse proxy), it seems use acquisition to get correct link.
Example for same portal in production and in development:
production
https://mysite.com/my-folder/my-link
with remoteUrl = ${navigation_root_url}/my-other-folder
devl
http://localhost:8080/plone/my-folder/my-link
with same remoteUrl
generated link in dev is good (http://localhost:8080/plone/my-other-folder/)
but in production, it's not correct, indeed it's
https://mysite.com/plone/my-other-folder/
and it should be
https://mysite.com/my-other-folder/
'plone' path should not be in the link.
It maybe works with acquisition, but it's not correct .
So I simply replace '/'.join(obj.getPhysicalPath()) by
obj.absolute_url()
Is there good reason to use getPhysicalPath instead of absolute_url?
Here is how to reproduce with docker-compose.yml file and a reverse proxy :
then you have