Go to the Content Settings control panel (@@content-controlpanel)
Select Folder and change the versioning policy from 'No versioning' to 'Automatic'.
Create a new Folder. Optionally re-edit and make changes so you have more than one version.
Go to the @@historyview of the folder.
Click to view a version. URL will be something like http://localhost:8080/Plone/folder/versions_history_form?version_id=0
What I expect to happen:
I see a preview of this version of the folder. I should at least see the Title and Description. Probably not the contents.
What actually happened:
The preview tries to render the contents, and this fails:
2020-09-16 12:34:56,067 ERROR
[Zope.SiteErrorLog:252][waitress-3] 1600252496.0653130.3512923122528404
http://localhost:8080/Plone5/folder/versions_history_form
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 167, in transaction_pubevents
Module ZPublisher.WSGIPublisher, line 364, in publish_module
Module ZPublisher.WSGIPublisher, line 267, in publish
Module ZPublisher.mapply, line 85, in mapply
Module ZPublisher.WSGIPublisher, line 68, in call_object
Module Shared.DC.Scripts.Bindings, line 333, in __call__
Module Shared.DC.Scripts.Bindings, line 370, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 256, in _exec
Module Products.CMFCore.FSPageTemplate, line 197, in pt_render
Module Products.PageTemplates.PageTemplate, line 85, in pt_render
Module zope.pagetemplate.pagetemplate, line 135, in pt_render
Module Products.PageTemplates.engine, line 354, in __call__
Module z3c.pt.pagetemplate, line 176, in render
Module chameleon.zpt.template, line 307, in render
Module chameleon.template, line 192, in render
Module 65bc3958ea4280a8e580b18070b0e3a7, line 2180, in render
Module 9e70c50511abe7f75c119790389a8196, line 860, in render_master
Module 9e70c50511abe7f75c119790389a8196, line 1526, in render_content
Module 65bc3958ea4280a8e580b18070b0e3a7, line 1859, in __fill_main
Module zope.tales.expressions, line 250, in __call__
Module Products.PageTemplates.Expressions, line 192, in _eval
Module Products.PageTemplates.Expressions, line 123, in render
Module plone.app.versioningbehavior.browser, line 50, in __call__
Module plone.autoform.view, line 42, in __call__
Module plone.autoform.view, line 33, in render
Module Products.Five.browser.pagetemplatefile, line 126, in __call__
Module Products.Five.browser.pagetemplatefile, line 61, in __call__
Module zope.pagetemplate.pagetemplate, line 135, in pt_render
Module Products.PageTemplates.engine, line 354, in __call__
Module z3c.pt.pagetemplate, line 176, in render
Module chameleon.zpt.template, line 307, in render
Module chameleon.template, line 214, in render
Module chameleon.utils, line 75, in raise_with_traceback
Module chameleon.template, line 192, in render
Module 86eeca8896c21371062da21f169efafe, line 543, in render
Module 86eeca8896c21371062da21f169efafe, line 455, in render_content_core
Module da766ac8b74cfcceb09e0c979719152e, line 390, in render_listing
Module zope.tales.expressions, line 250, in __call__
Module Products.PageTemplates.Expressions, line 184, in _eval
Module zope.tales.expressions, line 153, in _eval
Module Products.PageTemplates.Expressions, line 102, in trustedBoboAwareZopeTraverse
Module zope.traversing.adapters, line 156, in traversePathElement
- __traceback_info__: (<Products.Five.browser.metaconfigure.SimpleViewClass from /Users/maurits/community/plone-coredev/py3/src/plone.dexterity/plone/dexterity/browser/containercontentcore.pt object at 0x11475a550>, 'batch')
Module zope.traversing.adapters, line 61, in traverse
- __traceback_info__: (<Products.Five.browser.metaconfigure.SimpleViewClass from /Users/maurits/community/plone-coredev/py3/src/plone.dexterity/plone/dexterity/browser/containercontentcore.pt object at 0x11475a550>, 'batch', [])
zope.location.interfaces.LocationError: zope.location.interfaces.LocationError: (<Products.Five.browser.metaconfigure.SimpleViewClass from /Users/maurits/community/plone-coredev/py3/src/plone.dexterity/plone/dexterity/browser/containercontentcore.pt object at 0x11475a550>, 'batch')
- Expression: "view/batch"
- Filename: ... ypes/plone/app/contenttypes/browser/templates/listing.pt
- Location: (line 22: col 31)
- Source: <tal:results define="batch view/batch;
^^^^^^^^^^
- Expression: "listing_macro"
- Filename: ... exterity/plone/dexterity/browser/containercontentcore.pt
- Location: (line 24: col 38)
- Source: ... metal:use_macro use-macro="listing_macro" />
^^^^^^^^^^^^^
- Expression: "context/main_template/macros/master"
- Filename: ... s/CMFEditions/skins/CMFEditions/versions_history_form.pt
- Location: (line 1: col 23)
- Source: ... l:use-macro="context/main_template/macros/master" i18n:domai ...
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: template: <Products.Five.browser.pagetemplatefile.ViewPageTemplateFile object at 0x1109599d0>
options: {}
args: ()
nothing: None
modules: <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter object at 0x10d847090>
request: <WSGIRequest, URL=http://localhost:8080/Plone5/folder/versions_history_form>
view: <Products.Five.browser.metaconfigure.SimpleViewClass from /Users/maurits/community/plone-coredev/py3/src/plone.dexterity/plone/dexterity/browser/containercontentcore.pt object at 0x11475a550>
context: <Folder at /Plone5/folder>
views: <Products.Five.browser.pagetemplatefile.ViewMapper object at 0x1149b2cd0>
here: <Folder at /Plone5/folder>
container: <Folder at /Plone5/folder>
root: <Application at >
traverse_subpath: []
user: <PropertiedUser 'admin'>
default: <DEFAULT>
repeat: <Products.PageTemplates.engine.RepeatDictWrapper object at 0x1149b4870>
loop: {'widget': <Products.PageTemplates.engine.RepeatItem object at 0x1149d0b90>, 'group': <Products.PageTemplates.engine.RepeatItem object at 0x1149d0c50>}
target_language: None
translate: <function BaseTemplate.render.<locals>.translate at 0x11487ee60>
What version of Plone/ Addons I am using:
Plone coredev 5.2, Python 3
Digging to the real problem
I pinned it down to this line in CMFEditions: version_view context/@@version-view|nothing
The template uses the context/folder_listing/macros/listing macro.
This macro is defined in plone.app.contenttypes and expects that view/batch and a few other methods/attributes exist, which in this case they don't.
So actually the problem can already be seen without CMFEditions/versioning: just add /@@content-core to the url of a folder and you will get the same error.
Now: where to fix this?
In plone.app.contenttypes in listing.pt we could change the tal define batch view/batch into batch view/batch|python: []. Plus a few similar fixes in the same template. Then you could use the listing macro on a view that has no batch. That may not make sense, but it would do the trick.
In plone.dexterity change containercontentcore.pt to not call the listing macro. From how it looks now, I think this has never worked, but I am not sure. It was introduced in 2013 and afterwards no real changes except white space. This would mean the content-core view would be the same for Items and Containers.
In plone.dexterity change the view to contain batch and other methods/attributes needed by the listing macro.
BUG/PROBLEM REPORT (OR OTHER COMMON ISSUE)
What I did:
@@content-controlpanel
)@@historyview
of the folder.http://localhost:8080/Plone/folder/versions_history_form?version_id=0
What I expect to happen:
I see a preview of this version of the folder. I should at least see the Title and Description. Probably not the contents.
What actually happened:
The preview tries to render the contents, and this fails:
What version of Plone/ Addons I am using:
Digging to the real problem
CMFEditions
:version_view context/@@version-view|nothing
version-view
is defined inplone.app.versioningbehavior
, and it fails calling thecontent-core
view.content-core
for folders is defined inplone.dexterity
with this view class and this template.context/folder_listing/macros/listing
macro.plone.app.contenttypes
and expects thatview/batch
and a few other methods/attributes exist, which in this case they don't.So actually the problem can already be seen without CMFEditions/versioning: just add
/@@content-core
to the url of a folder and you will get the same error.Now: where to fix this?
plone.app.contenttypes
inlisting.pt
we could change the tal definebatch view/batch
intobatch view/batch|python: []
. Plus a few similar fixes in the same template. Then you could use the listing macro on a view that has no batch. That may not make sense, but it would do the trick.plone.dexterity
changecontainercontentcore.pt
to not call the listing macro. From how it looks now, I think this has never worked, but I am not sure. It was introduced in 2013 and afterwards no real changes except white space. This would mean thecontent-core
view would be the same for Items and Containers.plone.dexterity
change the view to containbatch
and other methods/attributes needed by the listing macro.I would be in favour of solution two.