summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEarl Miles2010-04-08 21:20:16 (GMT)
committer Earl Miles2010-04-08 21:20:16 (GMT)
commitfd0d47a746f8128cb34b045de2c925f3026771a0 (patch)
treef2f05bd91a8bf98c5591d41d7253e631add39816
parent2f436ca9b894bc60487524000de63f9c11ad6ba4 (diff)
#765352: Fix for postgress versions prior to 8.3 which caused data loss in update.php. Note: This will not repair lost data. If you experienced this you must restore your views_display table from backup.
-rw-r--r--CHANGELOG.txt1
-rw-r--r--views.install21
2 files changed, 20 insertions, 2 deletions
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 7e2cdec..ed8dce1 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -4,6 +4,7 @@ Views 2.10
o #765760 by crea: New setting for raw node type had wrong default.
o #682888 by jcmarco: With zen and zen subthemes, the new $classes array could fail for row styles.
o #765340 by dereine: <front> token accidentally removed by html entity stripping from URLs.
+ o #765352: Fix for postgress versions prior to 8.3 which caused data loss in update.php. Note: This will not repair lost data. If you experienced this you must restore your views_display table from backup.
Views 2.9 (Apr 07, 2010)
Bug fixes:
diff --git a/views.install b/views.install
index 157e8a5..30689f4 100644
--- a/views.install
+++ b/views.install
@@ -425,7 +425,24 @@ function views_update_6009() {
$ret = array();
$schema = views_schema_6009();
- db_change_field($ret, 'views_display', 'display_options', 'display_options', $schema['views_display']['fields']['display_options']);
+
+ if ($GLOBALS['db_type'] == 'pgsql') {
+ $ret[] = update_sql('ALTER TABLE {views_display} RENAME "display_options" TO "display_options_old"');
+ db_add_field($ret, 'views_display', 'display_options', $schema['views_display']['fields']['display_options']);
+
+ $sql = "SELECT vid, id, display_options_old FROM {views_display}";
+ $result = db_query($sql);
+ while ($row = db_fetch_array($result)) {
+ $row['display_options_old'] = db_decode_blob($row['display_options_old']);
+ $sql = "UPDATE {views_display} SET display_options = '%s' WHERE vid = %d AND id = '%s'";
+ db_query($sql, $row['display_options_old'], $row['vid'], $row['id']);
+ }
+
+ db_drop_field($ret, 'views_display', 'display_options_old');
+ }
+ else {
+ db_change_field($ret, 'views_display', 'display_options', 'display_options', $schema['views_display']['fields']['display_options']);
+ }
return $ret;
-} \ No newline at end of file
+}