From 23a912aa6678bb16f866b01c175b8e73e7bf417d Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 23 Dec 2011 15:07:49 -0500 Subject: Refs #4239 fixed upgrade scripts with bad limits --- mod/groups/upgrades/2011030101.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'mod/groups/upgrades') diff --git a/mod/groups/upgrades/2011030101.php b/mod/groups/upgrades/2011030101.php index c2a80c08c..666ae3736 100644 --- a/mod/groups/upgrades/2011030101.php +++ b/mod/groups/upgrades/2011030101.php @@ -43,7 +43,11 @@ function groups_2011030101($topic) { return $annotation[0]->delete(); } -$options = array('type' => 'object', 'subtype' => 'groupforumtopic'); +$options = array( + 'type' => 'object', + 'subtype' => 'groupforumtopic', + 'limit' => 0, +); $batch = new ElggBatch('elgg_get_entities', $options, 'groups_2011030101', 100); if ($batch->callbackResult) { -- cgit v1.2.3 From 74f3f133432cfd4100b04db66b57dcc19ab09a20 Mon Sep 17 00:00:00 2001 From: cash Date: Fri, 23 Dec 2011 15:32:15 -0500 Subject: added access override to the forum upgrade --- mod/groups/upgrades/2011030101.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mod/groups/upgrades') diff --git a/mod/groups/upgrades/2011030101.php b/mod/groups/upgrades/2011030101.php index 666ae3736..9ed5b321b 100644 --- a/mod/groups/upgrades/2011030101.php +++ b/mod/groups/upgrades/2011030101.php @@ -25,7 +25,7 @@ foreach ($topics as $topic) { /** - * Condense annotation into object + * Condense first annotation into object * * @param ElggObject $topic */ @@ -43,12 +43,14 @@ function groups_2011030101($topic) { return $annotation[0]->delete(); } +$previous_access = elgg_set_ignore_access(true); $options = array( 'type' => 'object', 'subtype' => 'groupforumtopic', 'limit' => 0, ); $batch = new ElggBatch('elgg_get_entities', $options, 'groups_2011030101', 100); +elgg_set_ignore_access($previous_access); if ($batch->callbackResult) { error_log("Elgg Groups upgrade (2011030101) succeeded"); -- cgit v1.2.3 From 6dc5a90146595b78f5fd0d9b10b628a78ca2dac7 Mon Sep 17 00:00:00 2001 From: cash Date: Sat, 31 Dec 2011 10:18:01 -0500 Subject: Fixes #4256 reruns the forum topic upgrade by checking the 5 oldest topics --- mod/groups/upgrades/2011030101.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'mod/groups/upgrades') diff --git a/mod/groups/upgrades/2011030101.php b/mod/groups/upgrades/2011030101.php index 9ed5b321b..55edb1a16 100644 --- a/mod/groups/upgrades/2011030101.php +++ b/mod/groups/upgrades/2011030101.php @@ -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) -- cgit v1.2.3