]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4566 upgrades location metadata on users
authorcash <cash.costello@gmail.com>
Wed, 6 Mar 2013 20:26:14 +0000 (15:26 -0500)
committercash <cash.costello@gmail.com>
Wed, 6 Mar 2013 20:26:14 +0000 (15:26 -0500)
engine/lib/upgrades/2013030600-1.8.13-update_user_location-8999eb8bf1bdd9a3.php [new file with mode: 0644]
version.php

diff --git a/engine/lib/upgrades/2013030600-1.8.13-update_user_location-8999eb8bf1bdd9a3.php b/engine/lib/upgrades/2013030600-1.8.13-update_user_location-8999eb8bf1bdd9a3.php
new file mode 100644 (file)
index 0000000..b38eb51
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+/**
+ * Elgg 1.8.14 upgrade 2013030600
+ * update_user_location
+ *
+ * Before Elgg 1.8, a location like "London, England" would be stored as an array.
+ * This script turns that back into a string.
+ */
+
+global $DB_QUERY_CACHE;
+
+$ia = elgg_set_ignore_access(true);
+$options = array(
+       'type' => 'user',
+       'limit' => 0,
+);
+$batch = new ElggBatch('elgg_get_entities', $options);
+
+foreach ($batch as $entity) {
+       $DB_QUERY_CACHE = array();
+       
+       if (is_array($entity->location)) {
+               $entity->location = implode(', ', $entity->location);
+       }
+}
+elgg_set_ignore_access($ia);
index 07a08ab4a34895ba02c2890ab15bc1a4e2af8ebe..b5822b371544b17575438382f97ed9028bf5f81f 100644 (file)
@@ -5,13 +5,13 @@
  * This is compared against the values stored in the database to determine
  * whether upgrades should be performed.
  *
- * @package Elgg
+ * @package    Elgg
  * @subpackage Core
  */
 
 // YYYYMMDD = Elgg Date
 // XX = Interim incrementer
-$version = 2013012900;
+$version = 2013030600;
 
 // Human-friendly version name
-$release = '1.8.13';
+$release = '1.8.14';