-
-
Notifications
You must be signed in to change notification settings - Fork 208
Avoid a plone.protect warning on index_html documents in portal root.
#4281
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
Merged
+37
−2
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| 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 https://github.com/plone/plone.base/pull/107 and a | ||
| plone.protect warning issued by a write-on-read by setting the | ||
| `__replaceable__` attribute on the `index_html` object. | ||
|
|
||
| Fixes: https://github.com/plone/Products.CMFPlone/issues/4279 | ||
| [thet] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove this one you have to remove also the one in https://github.com/plone/Products.CMFPlone/pull/4281/changes#diff-108b30c9523956cc50ba0e46e6221344a0f9c01ad8c53e663a11c83ca854f248R171
for consistency (even if it is probably dead code).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ale-rt happy to remove it! But in the case of the WebDAV
__replaceableI thought it might be OK, as this is aNullResourceand someone might want to replace it with real content namedindex_html. But honestly, I'm guessing because I don't really know what the__replaceable__even is.Btw. I know some people still using WebDAV and IMO it could be a killer feature of Plone if it would work fine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thet @ale-rt
__replaceable__is used in https://github.com/zopefoundation/Zope/blob/c927fc8b004c624b1c86f359be00d138e98c34f7/src/OFS/ObjectManager.py#L122 to prevent giving a new item a name that can already be found by getattr -- unless the object is marked as replaceable.So this was kind of there to handle exactly the problem that you're trying to solve (being able to replace the index_html even though it is a method). Except the _check_for_collision in plone.base is not as smart as checkValidId in Zope, and doesn't pay attention to
__replaceable__.tl;dr: I think this change is ok as long as we merge it together with the one you made in plone.base
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ale-rt I'm undecided - is it now better to remove the
__replaceable__attribute setting for the WebDAV NullResource or not?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that anyway having a Plone server behind Zserver is very unlikely.
If somebody has issues he will ask for a change.