While looking for an example for @pigeonflight on how we use example.trajectory I stumbled on the traceback below when navigating to the article edit form. I was able to get my edit form to work by changing
metal:use-macro="here/main_template/macros/master"
to
metal:use-macro="here/@@main_template/macros/master"
(which I remember seeing in one of the training.plone.org courses but am unable to find right now)
What makes this change work?
2020-08-20 16:35:06 ERROR Zope.SiteErrorLog 1597934106.110.802185519336 http://192.168.0.245:8585/mdb/articles/00014/@@edit
Traceback (innermost last):
Module ZPublisher.Publish, line 138, in publish
Module ZPublisher.mapply, line 77, in mapply
Module ZPublisher.Publish, line 48, in call_object
Module plone.z3cform.layout, line 64, in __call__
Module plone.z3cform.layout, line 80, in render
Module Products.Five.browser.pagetemplatefile, line 125, in __call__
Module Products.Five.browser.pagetemplatefile, line 59, in __call__
Module zope.pagetemplate.pagetemplate, line 137, in pt_render
Module five.pt.engine, line 98, in __call__
Module z3c.pt.pagetemplate, line 163, in render
Module chameleon.zpt.template, line 261, in render
Module chameleon.template, line 191, in render
Module chameleon.template, line 171, in render
Module 411de03efebd9251e8460a3c34b3faf6.py, line 232, in render
Module five.pt.expressions, line 154, in __call__
Module five.pt.expressions, line 126, in traverse
Module zope.traversing.adapters, line 142, in traversePathElement
- __traceback_info__: (<example.trajectory.article.trajectory.ArticleWrapper object at 0x7ff6fd2a61d0>, 'main_template')
Module zope.traversing.adapters, line 56, in traverse
- __traceback_info__: (<example.trajectory.article.trajectory.ArticleWrapper object at 0x7ff6fd2a61d0>, 'main_template', ('macros', 'master'))
LocationError: (<example.trajectory.article.trajectory.ArticleWrapper object at 0x7ff6fd2a61d0>, 'main_template')
- Expression: "here/main_template/macros/master"
- Filename: ... m-3.0.10-py2.7.egg/plone/app/z3cform/templates/layout.pt
- Location: (line 6: col 23)
- Source: metal:use-macro="here/main_template/macros/master"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- Arguments: repeat: {...} (0)
template: <ViewPageTemplateFile - at 0x7ff6ffb785d0>
views: <ViewMapper - at 0x7ff6fff0f190>
modules: <instance - at 0x7ff70af68830>
args: <tuple - at 0x7ff7136b7050>
here: <ImplicitAcquisitionWrapper 00014 at 0x7ff70384e730>
user: <ImplicitAcquisitionWrapper - at 0x7ff70384db40>
nothing: <NoneType - at 0x8f5320>
container: <ImplicitAcquisitionWrapper 00014 at 0x7ff70384e730>
request: <instance - at 0x7ff703a8b170>
wrapped_repeat: <SafeMapping - at 0x7ff700144af8>
traverse_subpath: <list - at 0x7ff6fcf2d3f8>
default: <object - at 0x7ff7135d5530>
loop: {...} (0)
context: <ImplicitAcquisitionWrapper 00014 at 0x7ff70384e730>
view: <EditView edit at 0x7ff6fd36e190>
translate: <function translate at 0x7ff6fcd95b18>
root: <ImplicitAcquisitionWrapper Zope at 0x7ff7039c9730>
options: {...} (0)
target_language: <NoneType - at 0x8f5320>