Skip to content

Allow to create content with index_html id on the site root.#107

Merged
thet merged 1 commit intomainfrom
thet/4278-index-html
Feb 20, 2026
Merged

Allow to create content with index_html id on the site root.#107
thet merged 1 commit intomainfrom
thet/4278-index-html

Conversation

@thet
Copy link
Member

@thet thet commented Feb 19, 2026

First this needs to be merged in order to get the z3c.dependencychecker check green:
#108

The portal root has a index_html method which prevented content with the id index_html to be created and used as a default page.

Fixes: plone/Products.CMFPlone#4278

  • I signed and returned the Plone Contributor Agreement, and received and accepted an invitation to join a team in the Plone GitHub organization.
  • I verified there aren't any other open pull requests for the same change.
  • I followed the guidelines in Contributing to Plone.
  • I successfully ran code quality checks on my changes locally.
  • I successfully ran tests on my changes locally.
  • If needed, I added new tests for my changes.
  • If needed, I added documentation for my changes.
  • I included a change log entry in my commits.

If your pull request closes an open issue, include the exact text below, immediately followed by the issue number. When your pull request gets merged, then that issue will close automatically.

Closes plone/Products.CMFPlone#4278

@mister-roboto
Copy link

@thet 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!

@thet thet force-pushed the thet/4278-index-html branch 2 times, most recently from 67aeb71 to 30af74b Compare February 19, 2026 21:22
Copy link
Member

@davisagli davisagli left a comment

Choose a reason for hiding this comment

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

@thet Do things actually work once the item is created? My recollection is that traversal will find attributes (i.e. the index_html method on PloneSite) before it looks for subitems using getitem. That's the main reason that this code tries to prevent using names that would be found as attributes.

@thet
Copy link
Member Author

thet commented Feb 20, 2026

@davisagli yes, it works - the index_html method of the portal object is called but that line gets the content item and returns it.

I'm preparing another PR in CMFPlone which removes line below which sets __replaceable__ attribute, which in turn invokes a plone.protect write-on-read confirmation message.

thet added a commit to plone/Products.CMFPlone that referenced this pull request Feb 20, 2026
`index_html` are often used to create default pages in containers. On the
portal root this was prevented by a problem in a name collision checker in
plone.base, fixed in plone/plone.base#107 and a
plone.protect warning issued by a write-on-read by setting the
`__replaceable__` attribute on the `index_html` object.

Fixes: #4279
thet added a commit to plone/Products.CMFPlone that referenced this pull request Feb 20, 2026
`index_html` are often used to create default pages in containers. On the
portal root this was prevented by a problem in a name collision checker in
plone.base, fixed in plone/plone.base#107 and a
plone.protect warning issued by a write-on-read by setting the
`__replaceable__` attribute on the `index_html` object.

Fixes: #4279
The portal root has a `index_html` method which prevented content with the id
`index_html` to be created and used as a default page.

Fixes: plone/Products.CMFPlone#4278
@thet thet force-pushed the thet/4278-index-html branch from 30af74b to 98fdc66 Compare February 20, 2026 17:34
@thet thet merged commit 756e77e into main Feb 20, 2026
12 checks passed
@thet thet deleted the thet/4278-index-html branch February 20, 2026 19:45
thet added a commit to plone/Products.CMFPlone that referenced this pull request Feb 20, 2026
`index_html` are often used to create default pages in containers. On the
portal root this was prevented by a problem in a name collision checker in
plone.base, fixed in plone/plone.base#107 and a
plone.protect warning issued by a write-on-read by setting the
`__replaceable__` attribute on the `index_html` object.

Fixes: #4279
mister-roboto pushed a commit to plone/buildout.coredev that referenced this pull request Feb 23, 2026
Branch: refs/heads/master
Date: 2026-02-20T20:55:20+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/Products.CMFPlone@ba5ba5e

Avoid a plone.protect warning on `index_html` documents in portal root.

`index_html` are often used to create default pages in containers. On the
portal root this was prevented by a problem in a name collision checker in
plone.base, fixed in plone/plone.base#107 and a
plone.protect warning issued by a write-on-read by setting the
`__replaceable__` attribute on the `index_html` object.

Fixes: plone/Products.CMFPlone#4279

Files changed:
A news/4279.bugfix.md
M src/Products/CMFPlone/Portal.py
M src/Products/CMFPlone/tests/testPortalCreation.py
Repository: Products.CMFPlone

Branch: refs/heads/master
Date: 2026-02-23T17:16:33+01:00
Author: Johannes Raggam (thet) <thetetet@gmail.com>
Commit: plone/Products.CMFPlone@8b0f067

Merge pull request #4281 from plone/thet/4279-index-html

Avoid a plone.protect warning on `index_html` documents in portal root.

Files changed:
A news/4279.bugfix.md
M src/Products/CMFPlone/Portal.py
M src/Products/CMFPlone/tests/testPortalCreation.py
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.

Cannot create index_html TTW on site root

3 participants