[Erp5-dev] allowed content type has None values
Romain Courteaud
romain at nexedi.com
Thu May 24 18:12:45 CEST 2007
Hello Jacek,
This issue was already discussed some days ago.
http://article.gmane.org/gmane.comp.python.zope.erp5.devel/1023
The issue comes from a wrong portal type configuration, which raise a
error in CMFBTreeFolder.
Generally speaking, it's good to raise error in the system if something
is wrong, so, CMFBTreeFolder will not be modified to catch this issue.
But it can be changed to raise another kind of order in order to fix the
issue more easily.
What is more important is to find why your portal type was in a bad
configuration state. One possibility is a bad Business Template
configuration.
Romain
* Jacek Medrzycki [2007-05-24 17:54:23 +0200]:
> Hi
>
> Today I have upgraded rather old site (february/march) and I 've got the
> following error while trying to display documents:
>
> * Module Products.ERP5Type.patches.CMFBTreeFolder, line 53, in
> CMFBTreeFolder_allowedContentTypes
> * Module Products.ERP5Type.patches.CMFBTreeFolder, line 52, in <lambda>
>
> AttributeError: 'NoneType' object has no attribute 'isConstructionAllowed'
>
>
> I have found that in Products.ERP5Type.patches.CMFBTreeFolder, in
> CMFBTreeFolder_allowedContentTypes, the list of portal types contains
> None value, so the filter fails on typ.isConstructionAllowed(...)
>
> I've made small (and rather ugly ;) patch that filters out None value,
> and the site appears to work after applying this. However, I don't know
> why allowed content type list contains None. Is it becouse of the old
> site I had, or something is broken in ERP5? Did anybody have similar
> symptoms?
>
> Regards, Jacek
>
> the patch:
> Index: CMFBTreeFolder.py
> ===================================================================
> --- CMFBTreeFolder.py (revision 14597)
> +++ CMFBTreeFolder.py (working copy)
> @@ -51,7 +51,7 @@
>
> return filter( lambda typ, container=self:
> typ.isConstructionAllowed( container )
> - , result )
> + , filter(lambda typ: typ is not None,result) )
>
> _______________________________________________
> Erp5-dev mailing list
> Erp5-dev at erp5.org
> http://erp5.org/mailman/listinfo/erp5-dev
More information about the Erp5-dev
mailing list