]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/favorited.php
Ticket #1094 Facebook app invites page was failing if no friends had added the app yet
[quix0rs-gnu-social.git] / actions / favorited.php
index 0223564f34e754fbdc27eba4bea23d723b3d29ce..fd5ff413cbbfd9cc8f0ac478c7aa084a7c0d43ca 100644 (file)
@@ -104,6 +104,9 @@ class FavoritedAction extends Action
     {
         parent::prepare($args);
         $this->page = ($this->arg('page')) ? ($this->arg('page')+0) : 1;
+        
+        common_set_returnto($this->selfUrl());
+        
         return true;
     }
 
@@ -181,10 +184,9 @@ class FavoritedAction extends Action
             $qry .= ' LIMIT ' . $offset . ', ' . $limit;
         }
 
-        // XXX: Figure out how to cache this query
-
-        $notice = new Notice;
-        $notice->query(sprintf($qry, common_config('popular', 'dropoff')));
+        $notice = Memcached_DataObject::cachedQuery('Notice',
+                                                    sprintf($qry, common_config('popular', 'dropoff')),
+                                                    600);
 
         $nl = new NoticeList($notice, $this);