Index: C:/eZpublish/www/ezp_trunk/kernel/classes/ezcontentclassattribute.php
===================================================================
--- C:/eZpublish/www/ezp_trunk/kernel/classes/ezcontentclassattribute.php	(revision 19584)
+++ C:/eZpublish/www/ezp_trunk/kernel/classes/ezcontentclassattribute.php	(working copy)
@@ -275,6 +275,8 @@
         
         global $eZContentClassAttributeCacheListFull;
         unset( $eZContentClassAttributeCacheListFull );
+        global $eZContentClassAttributeCacheList;
+        unset( $eZContentClassAttributeCacheList[$this->attribute( 'contentclass_id' )] );
         global $eZContentClassAttributeCache;
         unset( $eZContentClassAttributeCache[$this->ID] );
 
@@ -305,6 +307,8 @@
         
         global $eZContentClassAttributeCacheListFull;
         unset( $eZContentClassAttributeCacheListFull );
+        global $eZContentClassAttributeCacheList;
+        unset( $eZContentClassAttributeCacheList[$this->attribute( 'contentclass_id' )] );
         global $eZContentClassAttributeCache;
         unset( $eZContentClassAttributeCache[$this->ID] );
 
@@ -335,6 +339,8 @@
         {
             global $eZContentClassAttributeCacheListFull;
             unset( $eZContentClassAttributeCacheListFull );
+            global $eZContentClassAttributeCacheList;
+            unset( $eZContentClassAttributeCacheList[$this->attribute( 'contentclass_id' )] );
             global $eZContentClassAttributeCache;
             unset( $eZContentClassAttributeCache[$this->ID] );
             
@@ -434,18 +440,21 @@
         {
             $cond = array( 'contentclass_id' => $classID,
                            'version' => $version );
-            $objectList = eZPersistentObject::fetchObjectList( eZContentClassAttribute::definition(),
+            $objects = eZPersistentObject::fetchObjectList( eZContentClassAttribute::definition(),
                                                                 null, $cond, null, null,
                                                                 $asObject );
-            foreach ( array_keys( $objectList ) as $objectKey )
+            if ( $asObject )
             {
-                $objectItem =& $objectList[$objectKey];
-                $objectID = $objectItem->ID;
-                $objectVersion = $objectItem->Version;
-                if ( !isset( $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] ) )
-                    $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] =& $objectItem;
+                foreach ( array_keys( $objects ) as $objectKey )
+                {
+                    $objectItem =& $objects[$objectKey];
+                    $objectID = $objectItem->ID;
+                    $objectVersion = $objectItem->Version;
+                    if ( !isset( $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] ) )
+                        $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] =& $objectItem;
+                }
+                $GLOBALS['eZContentClassAttributeCacheList'][$classID][$version] =& $objects;
             }
-            $objects = $objectList;
         }
         return $objects;
     }
@@ -455,13 +464,16 @@
         $objectList = eZPersistentObject::fetchObjectList( eZContentClassAttribute::definition(),
                                                            null, $cond, null, null,
                                                            $asObject );
-        foreach ( array_keys( $objectList ) as $objectKey )
+        if ( $asObject )
         {
-            $objectItem =& $objectList[$objectKey];
-            $objectID = $objectItem->ID;
-            $objectVersion = $objectItem->Version;
-            if ( !isset( $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] ) )
-                $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] =& $objectItem;
+            foreach ( array_keys( $objectList ) as $objectKey )
+            {
+                $objectItem =& $objectList[$objectKey];
+                $objectID = $objectItem->ID;
+                $objectVersion = $objectItem->Version;
+                if ( !isset( $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] ) )
+                    $GLOBALS['eZContentClassAttributeCache'][$objectID][$objectVersion] =& $objectItem;
+            }
         }
         return $objectList;
     }
