Skip to content

Translate virtual hosting paths to physical paths in path criteria - #204

Open
petschki wants to merge 1 commit into
masterfrom
pathbyroot-vhm-fix
Open

petschki wants to merge 1 commit into
masterfrom
pathbyroot-vhm-fix

Conversation

@petschki

Copy link
Copy Markdown
Member

Behind a Virtual Host Monster clients (e.g. pat-filemanager via plone.restapi's @querystring-search) send the URL path, which is relative to the virtual root. _pathByRoot prepended the navigation root or portal path instead, which only works if both roots coincide. Subsites or language folders as virtual root, contexts inside a navigation root and _vh_ inside-out hosting returned wrong or no results.

Use request.physicalPathFromURL when virtual hosting is active and the path is not already a physical portal path.

See plone/plone.restapi#2023

Behind a Virtual Host Monster clients (e.g. pat-filemanager via
plone.restapi's @querystring-search) send the URL path, which is relative
to the virtual root. `_pathByRoot` prepended the navigation root or portal
path instead, which only works if both roots coincide. Subsites or language
folders as virtual root, contexts inside a navigation root and `_vh_`
inside-out hosting returned wrong or no results.

Use `request.physicalPathFromURL` when virtual hosting is active and the
path is not already a physical portal path.

See plone/plone.restapi#2023

Assisted-by: Claude Code (claude-opus-5-5)
@mister-roboto

Copy link
Copy Markdown

@petschki thanks for creating this Pull Request and helping to improve Plone!

TL;DR: Finish pushing changes, pass all other checks, then paste a comment:

@jenkins-plone-org please run jobs

To ensure that these changes do not break other parts of Plone, the Plone test suite matrix needs to pass, but it takes 30-60 min. Other CI checks are usually much faster and the Plone Jenkins resources are limited, so when done pushing changes and all other checks pass either start all Jenkins PR jobs yourself, or simply add the comment above in this PR to start all the jobs automatically.

Happy hacking!

@petschki

Copy link
Copy Markdown
Member Author

@jenkins-plone-org please run jobs

@thet
thet self-requested a review September 26, 2026 10:40
@Itsstephhhxoxo

This comment was marked as spam.

Itsstephhhxoxo

This comment was marked as spam.

@erral erral left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have tested this in our website, where I installed the new pat-filemanager and it works.

My usecase is a multilingual site with LanguageRootFolders, I don't have the use-case with subpaths (using _vh_XXXXX in the URL).

@erral

erral commented Sep 30, 2026

Copy link
Copy Markdown
Member

I have configured the site under a path, and it keeps working.

Thank you @petschki !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants