[Checkins] SVN: Products.CMFCore/branches/2.1/Products/CMFCore/ Merged r101298 and r101299 from trunk

Vincent Fretin vincent.fretin at gmail.com
Sun Jun 28 11:55:39 EDT 2009


Log message for revision 101300:
  Merged r101298 and r101299 from trunk

Changed:
  U   Products.CMFCore/branches/2.1/Products/CMFCore/CHANGES.txt
  U   Products.CMFCore/branches/2.1/Products/CMFCore/PortalFolder.py

-=-
Modified: Products.CMFCore/branches/2.1/Products/CMFCore/CHANGES.txt
===================================================================
--- Products.CMFCore/branches/2.1/Products/CMFCore/CHANGES.txt	2009-06-28 15:42:18 UTC (rev 101299)
+++ Products.CMFCore/branches/2.1/Products/CMFCore/CHANGES.txt	2009-06-28 15:55:38 UTC (rev 101300)
@@ -4,6 +4,9 @@
 2.1.3-beta (unreleased)
 -----------------------
 
+- PortalFolder: Modified allowedContentTypes method to check 
+  isConstructionAllowed only for allowed types, not for all content types.
+
 - Fixed typo in the acquisition wrapping of the found utility in
   getToolByName.
 
@@ -44,8 +47,9 @@
 
 - fiveactionstool: fix typo in a method name that isn't even used in the CMF 
   or Plone.
+  (https://bugs.launchpad.net/zope-cmf/+bug/257259)
 
-- test fixture: Fix failng tests with GenericSetup > 1.3 by explicitly
+- test fixture: Fix failing tests with GenericSetup > 1.3 by explicitly
   loading GS' meta.zcml during setup.
 
 

Modified: Products.CMFCore/branches/2.1/Products/CMFCore/PortalFolder.py
===================================================================
--- Products.CMFCore/branches/2.1/Products/CMFCore/PortalFolder.py	2009-06-28 15:42:18 UTC (rev 101299)
+++ Products.CMFCore/branches/2.1/Products/CMFCore/PortalFolder.py	2009-06-28 15:55:38 UTC (rev 101300)
@@ -126,20 +126,15 @@
             List type info objects for types which can be added in
             this folder.
         """
-        result = []
         portal_types = getToolByName(self, 'portal_types')
         myType = portal_types.getTypeInfo(self)
+        result = portal_types.listTypeInfo()
 
         if myType is not None:
-            for contentType in portal_types.listTypeInfo(self):
-                if myType.allowType( contentType.getId() ):
-                    result.append( contentType )
-        else:
-            result = portal_types.listTypeInfo()
+            return [t for t in result if myType.allowType(t.getId()) and
+                    t.isConstructionAllowed(self)]
 
-        return filter( lambda typ, container=self:
-                          typ.isConstructionAllowed( container )
-                     , result )
+        return [t for t in result if t.isConstructionAllowed(self)]
 
     def _filteredItems( self, ids, filt ):
         """



More information about the Checkins mailing list