]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4256 reruns the forum topic upgrade by checking the 5 oldest topics
authorcash <cash.costello@gmail.com>
Sat, 31 Dec 2011 15:18:01 +0000 (10:18 -0500)
committercash <cash.costello@gmail.com>
Sat, 31 Dec 2011 15:18:01 +0000 (10:18 -0500)
mod/groups/upgrades/2011030101.php

index 9ed5b321bdb28272929b13a41c1c1d1174c7c0db..55edb1a161384cea838b68677a531b16483210a6 100644 (file)
@@ -9,6 +9,7 @@ $topics = elgg_get_entities(array(
        'type' => 'object',
        'subtype' => 'groupforumtopic',
        'limit' => 5,
+       'order_by' => 'e.time_created asc',
 ));
 
 // if not topics, no upgrade required
@@ -31,6 +32,11 @@ foreach ($topics as $topic) {
  */
 function groups_2011030101($topic) {
 
+       // do not upgrade topics that have already been upgraded
+       if ($topic->description) {
+               return true;
+       }
+
        $annotation = $topic->getAnnotations('group_topic_post', 1);
        if (!$annotation) {
                // no text for this forum post so we delete (probably caused by #2624)