[Zope] TypeError: 'in <string>' requires character as left operand
Gordon Sullivan
gordon at gortek.com
Fri Nov 7 13:52:01 EST 2003
The traceback is at the bottom.
Thanks!
Quoting "Wilson, Derek" <dwilson at abrazohealth.com>:
> Yes, posting the traceback would be a good way for us to help show you
> where to look.
>
> Thanks,
> Derek Wilson
>
>
> -----Original Message-----
> From: Gordon Sullivan [mailto:gordon at gortek.com]
> Sent: Thursday, November 06, 2003 10:53 PM
> To: zope at zope.org
> Subject: [Zope] TypeError: 'in <string>' requires character as left
> operand
>
>
>
> Hi,
>
> I seem to have messed up my Plone real good. I'm not sure, but I think
> what I did to cause this was clicking the drop-down on the preferences
> screen for the editor. There was only one selection, 'None'.
>
> Now if I try to access /folder_contents for any folder, it gives me a
> Site error and the message:
>
> "'in ' requires character as left operand".
>
> I'm running the windoze install-shield version of plone [ (Zope 2.6.1
> (binary release, python 2.1, win32-x86), python 2.1.3, win32)] on my
> computer at work. I just started showing my managers how cool Plone is
> today, so of course I had to break it... 8~[
>
> I've googled and seen references such as these:
>
> (http://mail.zope.org/pipermail/zope-cmf/2003-April/018187.html)
> <snip>
> > The simplest thing possible is to add another check
> > on line line 174 in TypesTool.py
> >
> > if not self.allowed_content_types: return 0
> </snip>
>
>
> And also this:
>
> (http://copilotconsulting.com/mail-archives/zope.2003/11509.html)
> <snip>
>
> Figuring this out was the hard part. Fixing it was easy: Zope provides a
> simple 'argument conversion' facility. Adding ':list' to the addForm
> HTML form ensures that the multiple field value(s) will always be
> treated as a Python list, even if the multiple field only had a single
> value.
>
> To illustrate the fix (similar to the one I made in my 'addForm' HTML),
> assume the line with the problem property was:
>
> <input type="checkbox" name="choices" value="choice_one" />
>
> Change it to the following, which - via ':list' - ensures the Zope
> argument conversion of 'choices' so that it is always a list:
>
> <input type="checkbox" name="choices:list" value="choice_one" />
>
> </snip>
>
>
> I've also read Issue 1336
> (http://plone.org/collector/1336/ISSUE_TRANSCRIPT/view) of Issue
> Collector [Plone] that discusses this problem, and now I remember
> experimenting with the 'Allow Discussion' checkbox at some
> point... Maybe that's what caused it?
>
>
> I'm not sure what to make of things because I'm pretty new to the guts
> of Zope and Plone. Whatever I did to cause this problem I did from the
> user interface of plone, not the ZMI or editing python files.
>
>
> If it will help I can send the traceback from the Site error log.
>
>
> Does anyone know what the fix for this is?
>
> Thanks so much,
> Gordon Sullivan
>
>
> _______________________________________________
> Zope maillist - Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> ** No cross posts or HTML encoding! **
> (Related lists -
> http://mail.zope.org/mailman/listinfo/zope-announce
> http://mail.zope.org/mailman/listinfo/zope-dev )
>
=======================================================================
Begin Traceback
=======================================================================
Traceback (innermost last):
Module ZPublisher.Publish, line 98, in publish
Module ZPublisher.mapply, line 88, in mapply
Module ZPublisher.Publish, line 39, in call_object
Module Shared.DC.Scripts.Bindings, line 252, in __call__
Module Shared.DC.Scripts.Bindings, line 283, in _bindAndExec
Module Products.CMFCore.FSPageTemplate, line 169, in _exec
Module Products.PageTemplates.ZopePageTemplate, line 228, in _exec
Module Products.CMFCore.FSPageTemplate, line 141, in pt_render
Module Products.PageTemplates.PageTemplate, line 95, in pt_render
- <FSPageTemplate at /Plone/folder_contents used for /Plone/Members>
Module TAL.TALInterpreter, line 200, in __call__
Module TAL.TALInterpreter, line 244, in interpret
Module TAL.TALInterpreter, line 703, in do_useMacro
Module TAL.TALInterpreter, line 244, in interpret
Module TAL.TALInterpreter, line 726, in do_defineSlot
Module TAL.TALInterpreter, line 244, in interpret
Module TAL.TALInterpreter, line 682, in do_defineMacro
Module TAL.TALInterpreter, line 244, in interpret
Module TAL.TALInterpreter, line 473, in do_setLocal_tal
Module Products.PageTemplates.TALES, line 217, in evaluate
- Line 66, Column 12
- Expression: <PythonExpr here.sortObjects(here.allowedContentTypes())>
- Names:
{'container': <PloneSite instance at 01C6FF08>,
'default': <Products.PageTemplates.TALES.Default instance at 00E6D544>,
'here': <PloneFolder instance at 0229AA48>,
'loop': <SafeMapping instance at 01FEACB8>,
'modules': <Products.PageTemplates.ZRPythonExpr._SecureModuleImporter
instance at 00823ACC>,
'nothing': None,
'options': {'args': ()},
'repeat': <SafeMapping instance at 01FEACB8>,
'request': <HTTPRequest, URL=http://csc-2116/Members/folder_contents>,
'root': <Application instance at 01666AE8>,
'template': <FSPageTemplate at /Plone/folder_contents used for
/Plone/Members>,
'traverse_subpath': [],
'user': tony}
Module Products.PageTemplates.ZRPythonExpr, line 48, in __call__
- __traceback_info__: here.sortObjects(here.allowedContentTypes())
Module Python expression "here.sortObjects(here.allowedContentTypes())", line
2, in f
Module Products.CMFCore.PortalFolder, line 122, in allowedContentTypes
Module Products.CMFCore.TypesTool, line 175, in allowType
TypeError: 'in <string>' requires character as left operand
More information about the Zope
mailing list