aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-12-31 09:55:25 -0500
committercash <cash.costello@gmail.com>2011-12-31 09:55:25 -0500
commitbe12f79b9dd16202b774b4c42e07be395f00eff7 (patch)
tree80e48c4ccd2c697b940be5842d0234fe0be209d0
parentc5cee37b025a2654d1a5c427ac7a709ecf4b5350 (diff)
downloadelgg-be12f79b9dd16202b774b4c42e07be395f00eff7.tar.gz
elgg-be12f79b9dd16202b774b4c42e07be395f00eff7.tar.bz2
Fixes #4239 rerun corrected blog status upgrade
-rw-r--r--engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php25
-rw-r--r--version.php2
2 files changed, 26 insertions, 1 deletions
diff --git a/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php b/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php
new file mode 100644
index 000000000..e351c6ac9
--- /dev/null
+++ b/engine/lib/upgrades/2011123101-1.8.2-fix_blog_status-b14c2a0e7b9e7d55.php
@@ -0,0 +1,25 @@
+<?php
+/**
+ * Elgg 1.8.2 upgrade 2011123101
+ * fix_blog_status
+ *
+ * Most blog posts did not have their status properly set with 1.8 upgrade so we run
+ * the blog status upgrade again
+ */
+
+$ia = elgg_set_ignore_access(true);
+$options = array(
+ 'type' => 'object',
+ 'subtype' => 'blog',
+ 'limit' => 0,
+);
+$batch = new ElggBatch('elgg_get_entities', $options);
+
+foreach ($batch as $entity) {
+ if (!$entity->status) {
+ // create metadata owned by the original owner
+ create_metadata($entity->getGUID(), 'status', 'published', '', $entity->owner_guid,
+ $entity->access_id);
+ }
+}
+elgg_set_ignore_access($ia); \ No newline at end of file
diff --git a/version.php b/version.php
index 08c1e2513..455f77ad1 100644
--- a/version.php
+++ b/version.php
@@ -11,7 +11,7 @@
// YYYYMMDD = Elgg Date
// XX = Interim incrementer
-$version = 2011123100;
+$version = 2011123101;
// Human-friendly version name
$release = '1.8.2';