Module ZPublisher.Publish, line 100, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Products.ZWiki.UI, line 353, in editform Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.CMFCore.FSPageTemplate, line 191, in _exec Module Products.CMFCore.FSPageTemplate, line 124, in pt_render Module Products.PageTemplates.PageTemplate, line 96, in pt_render - <FSPageTemplate at /testsite/editform used for /testsite/wiki/Wiki_Page.2004-02-27.1506469028> Module TAL.TALInterpreter, line 189, in __call__ Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 663, in do_useMacro Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_op tTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 686, in do_defineSlot Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 629, in do_condition Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 605, in do_loop_tal Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 459, in do_setLocal_tal Module Products.PageTemplates.TALES, line 221, in evaluate - Line 237, Column 16 - Expression: <PythonExpr type.find('dtml') != -1 and here.dtmlAllowed()> - Names: {'container': <PloneSite instance at 43ce76b0>, 'context': <ZWikiPage at /testsite/wiki/Wiki_Page.2004-02-27.1506469028>, 'default': <Products.PageTemplates.TALES.Default instance at 0x40c204cc>, 'here': <ZWikiPage at /testsite/wiki/Wiki_Page.2004-02-27.1506469028>, 'loop': <SafeMapping instance at 43ce15b0>, 'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter instance at 0x40c201cc>, 'nothing': None, 'options': {'action': 'Change', 'args': (<ZWikiPage at /testsite/wiki/Wiki_Page.2004-02-27.1506469028>, <HTTPRequest, URL=http://localhost:10080/testsite/wiki/Wiki_Page.2004-02-27.1506469028/editform>), 'id': 'Wiki_Page.2004-02-27.1506469028', 'oldid': 'Wiki_Page.2004-02-27.1506469028', 'page': 'Wiki_Page.2004-02-27.1506469028', 'text': ''}, 'repeat': <SafeMapping instance at 43ce15b0>, 'request': <HTTPRequest, URL=http://localhost:10080/testsite/wiki/Wiki_Page.2004-02-27.1506469028/editform>, 'root': <Application instance at 43d0cf20>, 'template': <FSPageTemplate at /testsite/editform used for /testsite/wiki/Wiki_Page.2004-02-27.1506469028>, 'traverse_subpath': [], 'user': heimes} Module Products.PageTemplates.ZRPythonExpr, line 47, in __call__ - __traceback_info__: type.find('dtml') != -1 and here.dtmlAllowed() Module Python expression "type.find('dtml') != -1 and here.dtmlAllowed()", line 1, in <expression> AttributeError: find
Solution: Change allowed_types into allowed_page_types (editform.pt). allowed_types is used by plone2 (it's a list of factory type informations)
thank you, fixed for 0.28 (TAL bug IMHO) --simon, Fri, 27 Feb 2004 13:24:16 -0800 reply
Severity: critical => serious Status: open => closed
same problem with 0.30 --Mon, 17 May 2004 09:32:00 -0700 reply
same problem with: ZWiki-0.30.0, Zope-2.7.0 and Plone-2.0.2
Although editform.pt reads:
9 <tal:block define="global page options/page; 12 global pagetypes here/allowedPageTypes; 21 " /> 222 <tal:formats repeat="type pagetypes" 236 <label for="pagetype" 238 tal:define="dtmlallowed python:type.find('dtml')!=-1 and here.dtmlAllowed(); 239 extrasuffix python:dtmlallowed and ' (+ DTML)' or ''; " 240 tal:content="python: 241 here.PAGE_TYPES.get(type,type) + extrasuffix" 242 tal:attributes="for python:type; 243 i18n:translate python:type #XXX;" 244 >TestPage type</label> <br /> 245 </tal:formats>
still getting the nearly exact same error as above:
This wiki's editform template gave an error. Traceback (most recent call last): File "/var/zope/Products/ZWiki/UI.py", line 380, in editform oldid=self.id()) File "/usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 306, in __call__ return self._bindAndExec(args, kw, None) File "/usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec return self._exec(bound_data, args, kw) File "/var/zope/Products/CMFCore/FSPageTemplate.py", line 191, in _exec result = self.pt_render(extra_context=bound_names) File "/var/zope/Products/CMFCore/FSPageTemplate.py", line 124, in pt_render result = FSPageTemplate.inheritedAttribute('pt_render')( File "/usr/local/zope/lib/python/Products/PageTemplates/PageTemplate.py", line 96, in pt_render tal=not source, strictinsert=0)() File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 189, in __call__ self.interpret(self.program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 663, in do_useMacro self.interpret(macro) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 408, in do_optTag_tal self.do_optTag(stuff) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 393, in do_optTag return self.no_tag(start, program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 388, in no_tag self.interpret(program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 686, in do_defineSlot self.interpret(slot) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 629, in do_condition self.interpret(block) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 605, in do_loop_tal self.interpret(block) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 408, in do_optTag_tal self.do_optTag(stuff) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 393, in do_optTag return self.no_tag(start, program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 388, in no_tag self.interpret(program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 459, in do_setLocal_tal self.engine.setLocal(name, self.engine.evaluateValue(expr)) File "/usr/local/zope/lib/python/Products/PageTemplates/TALES.py", line 220, in evaluate return expression(self) File "/usr/local/zope/lib/python/Products/PageTemplates/ZRPythonExpr.py", line 47, in __call__ return eval(code, g, {}) File "Python expression "type.find('dtml')!=-1 and here.dtmlAllowed()"", line 1, in
AttributeError?: find
Maybe this has something to do with the recent upgrade to Plone-2.0.2?
Finally, I customized editform.pt with:
238 tal:define="dtmlallowed python:here.dtmlAllowed() or -1;
And then got more errors about the page types:
This wiki's editform template gave an error. Traceback (most recent call last): File "/var/zope/Products/ZWiki/UI.py", line 380, in editform oldid=self.id()) File "/usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 306, in __call__ return self._bindAndExec(args, kw, None) File "/usr/local/zope/lib/python/Shared/DC/Scripts/Bindings.py", line 343, in _bindAndExec return self._exec(bound_data, args, kw) File "/usr/local/zope/lib/python/Products/PageTemplates/ZopePageTemplate.py", line 222, in _exec result = self.pt_render(extra_context=bound_names) File "/usr/local/zope/lib/python/Products/PageTemplates/PageTemplate.py", line 96, in pt_render tal=not source, strictinsert=0)() File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 189, in __call__ self.interpret(self.program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 663, in do_useMacro self.interpret(macro) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 408, in do_optTag_tal self.do_optTag(stuff) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 393, in do_optTag return self.no_tag(start, program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 388, in no_tag self.interpret(program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 686, in do_defineSlot self.interpret(slot) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 629, in do_condition self.interpret(block) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 605, in do_loop_tal self.interpret(block) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 408, in do_optTag_tal self.do_optTag(stuff) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 393, in do_optTag return self.no_tag(start, program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 388, in no_tag self.interpret(program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 541, in do_insertTranslation self.interpretWithStream(stuff[1], tmpstream) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 213, in interpretWithStream self.interpret(program) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 233, in interpret handlers[opcode](self, args) File "/usr/local/zope/lib/python/TAL/TALInterpreter.py", line 483, in do_insertText_tal text = self.engine.evaluateText(stuff[0]) File "/usr/local/zope/lib/python/Products/PageTemplates/TALES.py", line 226, in evaluateText text = self.evaluate(expr) File "/usr/local/zope/lib/python/Products/PageTemplates/TALES.py", line 220, in evaluate return expression(self) File "/usr/local/zope/lib/python/Products/PageTemplates/ZRPythonExpr.py", line 47, in __call__ return eval(code, g, {}) File "Python expression "here.PAGE_TYPES.get(type,type) + extrasuffix"", line 1, in File "/usr/local/zope/lib/python/AccessControl/ZopeGuards.py", line 122, in guarded_get return guarded_getitem(d, key) File "/usr/local/zope/lib/python/AccessControl/ZopeGuards.py", line 67, in guarded_getitem v = object[index]
AttributeError?: __hash__
Thank you very much in advance for any help with this, Ben
property change --Mon, 17 May 2004 09:32:49 -0700 reply
Status: closed => open
it looks similar, but may not be the same --SimonMichael, Mon, 17 May 2004 19:29:23 -0700 reply
What does ANYPAGE/allowedPageTypes give you ?
Hi Simon,
So I try using here/allowedPageTypes by creating a test page template in my root folder, like:
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US" metal:use-macro="here/main_template/macros/master" i18n:domain="plone"> <body> <metal:main fill-slot="main"> <tal:main-macro metal:define-macro="main"> <h1 tal:content="template/title_or_id" class="documentFirstHeading"> Title or id </h1> <div metal:use-macro="here/document_actions/macros/document_actions"> Document actions (print, sendto etc) </div> <div id="bodyContent" class="stx" tal:replace="structure here/allowedPageTypes"> </div> <div metal:use-macro="here/document_byline/macros/byline"> Get the byline - contains details about author and modification date. </div> </tal:main-macro> </metal:main> </body> </html>
And I get a key error for allowedPageTypes:
Traceback (innermost last): Module ZPublisher.Publish, line 100, in publish Module ZPublisher.mapply, line 88, in mapply Module ZPublisher.Publish, line 40, in call_object Module Shared.DC.Scripts.Bindings, line 306, in __call__ Module Shared.DC.Scripts.Bindings, line 343, in _bindAndExec Module Products.PageTemplates.ZopePageTemplate, line 222, in _exec Module Products.PageTemplates.PageTemplate, line 96, in pt_render - <ZopePageTemplate at /seamap/test> Module TAL.TALInterpreter, line 189, in __call__ Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 663, in do_useMacro Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 686, in do_defineSlot Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 642, in do_defineMacro Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 408, in do_optTag_tal Module TAL.TALInterpreter, line 393, in do_optTag Module TAL.TALInterpreter, line 388, in no_tag Module TAL.TALInterpreter, line 233, in interpret Module TAL.TALInterpreter, line 561, in do_insertStructure_tal Module Products.PageTemplates.TALES, line 220, in evaluate - URL: /seamap/test - Line 14, Column 8 - Expression: standard:'here/allowedPageTypes' - Names: {'container': <PloneSite instance at 41fb4110>, 'context': <PloneSite instance at 41fb4110>, 'default': <Products.PageTemplates.TALES.Default instance at
- 0x40e49f2c>,
- 'here': <PloneSite? instance at 41fb4110>, 'loop': <SafeMapping? instance at 42909ec0>, 'modules': <Products.PageTemplates.ZRPythonExpr?._SecureModuleImporter? instance at
- 0x40e51cac>,
'nothing': None, 'options': {'args': ()}, 'repeat': <SafeMapping? instance at 42909ec0>, 'request': <HTTPRequest?, URL=http://green.env.duke.edu:8020/seamap/test>, 'root': <Application instance at 41fade30>, 'template': <ZopePageTemplate? at /seamap/test>, 'traverse_subpath': [], 'user': admin}
Module Products.PageTemplates.Expressions, line 201, in __call__ Module Products.PageTemplates.Expressions, line 189, in _eval Module Products.PageTemplates.Expressions, line 145, in _eval
- __traceback_info__: here
- Module Products.PageTemplates.Expressions, line 347, in restrictedTraverse
- __traceback_info__: {'path': ['allowedPageTypes']?,
- 'TraversalRequestNameStack?': []}
- Module OFS.ObjectManager?, line 656, in __getitem__
KeyError?: 'allowedPageTypes'
but allowedPageTypes is defined by Zwiki, so I'm not sure how the functions get imported or called since I'm a newbie:
[zope@green ZWiki]$ grep -ri 'def allowedPageTypes' * Editing.py: def allowedPageTypes(self): [zope@green ZWiki]$ vi Editing.py 920 def allowedPageTypes(self): 921 """ 922 This wiki's "allowed" page types, ie those offered in
- the edit form.
923 """ 924 if self.inCMF(): default = ALLOWED_PAGE_TYPES_IN_PLONE 925 else: default = ALLOWED_PAGE_TYPES 926 allowed = getattr(self,'allowed_page_types',default) 927 return filter(lambda x:strip(x),allowed)
- [zope@green ZWiki]?$ vi Defaults.py
- 21 # the page types we'll offer in the default edit form, 22 # unless overridden by an allowed_page_types property. 23 # These must match the ids in PageTypes?.py. 24 ALLOWED_PAGE_TYPES = [ 25 'msgstxprelinkdtmlfitissuehtml', 26 'msgrstprelinkfitissue', 27 'msgwwmlprelinkfitissue', 28 'dtmlhtml', 29 'plaintext', 30 ] 31 # ditto for wikis in CMF/Plone 32 ALLOWED_PAGE_TYPES_IN_PLONE = [ 33 'msgstxprelinkdtmlfitissuehtml', 34 'msgrstprelinkfitissue', 35 #'msgwwmlprelinkfitissue', 36 'dtmlhtml', 37 'plaintext', 38 ]
- set a custom allowed_page_types lines property on your wiki folder: # wiki page types
- 'msgstxprelinkfitissuehtml' :'Structured Text', 'msgstxprelinkdtmlfitissuehtml':'Structured Text + DTML', 'msgrstprelinkfitissue' :'reStructured Text', 'msgwwmlprelinkfitissue' :'WikiWikiWeb markup', # non-wiki page types 'html' :'HTML', 'dtmlhtml' :'HTML + DTML', 'plaintext' :'Plain text',
Thanks, Ben
> -----Original Message----- > From: SimonMichael [mailto:zwiki-wiki@zwiki.org]? > Sent: Monday, May 17, 2004 10:29 PM > Subject: [IssueNo0726? fail to create a new wiki page under > plone2 (+ solution)] it looks similar, but may not be the same > > > What does ANYPAGE/allowedPageTypes give you ?
it looks similar, but may not be the same --SimonMichael, Mon, 24 May 2004 04:33:17 -0700 reply
Hi Ben.. just make a wiki page, eg TestPage, in the problem wiki folder if possible, using the ZMI if necessary. View that page in your browser and then add '/allowedPageTypes' to the URL in your browser's address field.
it looks similar, but may not be the same --Ben Best, Mon, 24 May 2004 09:41:50 -0700 reply
Everything seems to work fine now. I can't trace what I accidentally did to fix it, though. I've added the allow_dtml propery, and now for /allowedPageTypes I get:
['msgstxprelinkdtmlfitissuehtml', 'msgrstprelinkfitissue', 'dtmlhtml',
'plaintext']
I'm closing this issue. Sorry about the false alarm, and thanks for all your help, Ben
> Hi Ben.. just make a wiki page, eg TestPage, in the problem > wiki folder if possible, using the ZMI if necessary. View > that page in your browser and then add '/allowedPageTypes' to > the URL in your browser's address field.
property change --Mon, 24 May 2004 09:42:32 -0700 reply
Status: open => closed