[Zope] TypeError: 'in <string>' requires character as left operand

Gordon Sullivan gordon at gortek.com
Mon Nov 10 12:49:04 EST 2003


Quoting Dieter Maurer <dieter at handshake.de>:

> Gordon Sullivan wrote at 2003-11-7 13:52 -0500:
>  > The traceback is at the bottom.
>  > ...
>  > > 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".  
>  > ...
>  >  Module Products.PageTemplates.PageTemplate, line 95, in pt_render
>  >   - <FSPageTemplate at /Plone/folder_contents used for /Plone/Members>
>  > ...
>  >    - Line 66, Column 12
>  >    - Expression: <PythonExpr
> here.sortObjects(here.allowedContentTypes())>
>  >    - Names:
>  > ...
>  >        'here': <PloneFolder instance at 0229AA48>,
>  >   Module Products.CMFCore.TypesTool, line 175, in allowType
>  > TypeError: 'in <string>' requires character as left operand
> 
> This indicates that the "allowed_content_types" attribute
> of the PloneFolder "/Plone/Members" is a string.
> It should be a sequence of strings.
> 
> There are HowTos around ("zope.org", "zopelabs") how to
> access the ZODB in an interactive Python interpreter.
> You can use this approach to fix the attribute.
> 
> When you have read (at least one of) these HowTos and still have
> questions, you can come back.
> 
> -- 
> Dieter
> 


Ok, assuming for now I figure out how to access my ZODB with an interactive
Python shell and repair the bad data without damaging anything else, how do I
prevent this from happening?  The problem isn't confined to one specific folder,
*all* folders exhibit this behavior.  I can see in the site error_log where new
users are signing up and getting that error on their personal Members folder.

It seems there was some faulty or non-existent data validation somewhere along
the line that set this bug in motion.

Just to see what would happen, I exported the Plone out of that install,
reinstalled the plone binary installer, and imported the zexp file.  It's the
same as before.

Thanks,
Gordon





More information about the Zope mailing list