]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '1.0.x' into activity
authorEvan Prodromou <evan@status.net>
Tue, 23 Aug 2011 04:17:39 +0000 (00:17 -0400)
committerEvan Prodromou <evan@status.net>
Tue, 23 Aug 2011 04:17:39 +0000 (00:17 -0400)
classes/Memcached_DataObject.php
lib/moremenu.php

index b857ae64b9fdfe79a6a9fdd5417b946963024229..51b1556d77a7144af412e7370c2779bcb1d3c2d9 100644 (file)
@@ -34,11 +34,12 @@ class Memcached_DataObject extends Safe_DataObject
     {
         if (is_null($v)) {
             $v = $k;
-            // XXX: HACK!
-            $i = new $cls;
-            $keys = $i->keys();
+            $keys = self::pkeyCols($cls);
+            if (count($keys) > 1) {
+               // FIXME: maybe call pkeyGet() ourselves?
+                throw new Exception('Use pkeyGet() for compound primary keys');
+            }
             $k = $keys[0];
-            unset($i);
         }
         $i = Memcached_DataObject::getcached($cls, $k, $v);
         if ($i === false) { // false == cache miss
index fa335b3c7b7dda1b712af7c8d615290ad6fe6040..8aed58a921aadbf57b6f8383e25a677880773888 100644 (file)
@@ -81,7 +81,12 @@ class MoreMenu extends Menu
             }
 
             foreach ($toShow as $item) {
-                list($actionName, $args, $label, $description, $id) = $item;
+               if (count($item) == 5) {
+                       list($actionName, $args, $label, $description, $id) = $item;
+               } else {
+                       list($actionName, $args, $label, $description) = $item;
+                       $id = null;                 
+               }
                 $this->item($actionName, $args, $label, $description, $id);
             }