i mean the "default_page_types" problem, not the TinyMCE richtext problem
oh ... sorry. This timeline is a bit confusing ... no I haven't tested it in VHM ... will do.
regression confirmed: select_default_page
is broken in VirtualHosted environments since plone.app.content = 4.1.3
(rm usage of folder.getFolderContents in test · plone/plone.app.content@0b08a9b · GitHub) -- used since Plone = 6.0.12
... there is obviously no test for VHM environments.
This is also on https://classic.demo.plone.org ... you cannot select a default page anymore.
Or use virtual_url_path()?
it uses getPhysicalPath + physicalPathToVirtualPath
But I think it is used in traversing, so the solution above by @petschki is cleaner.
The standard "/".join(context.getPhysicalPath())
(which was used until the last release) is best. For good measure I tried a few options with a local Plone 6.0.12 site with a folder and a page in it:
print(f"absolute_url = {context.absolute_url()}")
print(f" absolute_url_path = {context.absolute_url_path()}")
print(f" virtual_url_path = {context.virtual_url_path()}")
print(f"join getPhysicalPath = {'/'.join(context.getPhysicalPath())}")
I visit http://localhost:8080/Plone/folder/select_default_page and I can select the page:
absolute_url = http://localhost:8080/Plone/folder
absolute_url_path = /Plone/folder
virtual_url_path = Plone/folder
join getPhysicalPath = /Plone/folder
I visit http://localhost:8080/VirtualHostBase/http/plone.org/Plone/VirtualHostRoot/folder/select_default_page and I can not select the page:
absolute_url = http://plone.org:8080/folder
absolute_url_path = /folder
virtual_url_path = folder
join getPhysicalPath = /Plone/folder
The join with getPhysicalPath
is the only one that works in both cases.
The others may be fine in other cases. But in the case of the form for selecting a default page, the value is passed to the portal_catalog
for a path
query, so there we need the full path from the Zope root app: /Plone/folder
.
@petschki has fixed it in Fix `select_default_page` in VHM environments by petschki · Pull Request #292 · plone/plone.app.content · GitHub
I have released plone.app.content
4.1.7 with this. So if you have this problem, you can use that version.
@mauritsvanrees plan you an update of https://dist.plone.org/release/6.1-latest/constraints.txt ?
I won't update 6.1-latest
as it points to 6.1.0a4
and I won't update that, and won't make a full new Plone release for this.
But I have updated 6.1-dev
and 6.0-dev
with this and some other new package versions.
I have fixed the issue with required TinyMCE widgets in mockup = 2.2.0-alpha.10
and released it in plone.staticresources = 2.2.0a10
... the issue only affects Plone 6.1