From bc2f54e08c8ab9408dce7ab99ab8cf843ded4045 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 25 Apr 2006 17:38:58 +0000 Subject: [PATCH] Fix a typo in the Template/Parser.pm code. The SQL table patch for userSessionScratch won't apply if the table contains duplicate entries in the rows that will be set as keys. So the table is emptied before the patch is applied. --- docs/changelog/6.x.x.txt | 1 + docs/upgrades/upgrade_6.8.8-6.99.0.pl | 2 ++ lib/WebGUI/Asset/Template/Parser.pm | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 9bc5f7475..c972bf05c 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -124,6 +124,7 @@ - fix [ 1340839 ] If can't use item in adminConsole don't display it - Added SQL Form and error feedback for asset addition (Martin Kamerbeek/Procolix) - Added file upload ability to the rich text editor (Wouter van Oijen/ProcoliX) + - fix [ 1473937 ] scratch->set not taking. 6.8.8 - fix [ 1452466 ] File size not set in File asset (Thanks to Eric S) diff --git a/docs/upgrades/upgrade_6.8.8-6.99.0.pl b/docs/upgrades/upgrade_6.8.8-6.99.0.pl index 3bc28a5c2..423650eef 100644 --- a/docs/upgrades/upgrade_6.8.8-6.99.0.pl +++ b/docs/upgrades/upgrade_6.8.8-6.99.0.pl @@ -909,6 +909,8 @@ sub changeDbCacheTimeoutName { #------------------------------------------------- sub addScratchKeys { + print "\tClearing user session scratch table to add keys.\n"; + $session->db->write("delete from userSessionScratch"); print "\tAssigning keys to userSessionScratch.\n" unless ($quiet); $session->db->write("alter table userSessionScratch ADD PRIMARY KEY (sessionId, name)"); } diff --git a/lib/WebGUI/Asset/Template/Parser.pm b/lib/WebGUI/Asset/Template/Parser.pm index e8ee5802a..27352e399 100755 --- a/lib/WebGUI/Asset/Template/Parser.pm +++ b/lib/WebGUI/Asset/Template/Parser.pm @@ -43,7 +43,7 @@ sub addSessionVars { $vars->{"session.setting.anonymousRegistration"} = $self->session->setting->get("anonymousRegistration"); my $forms = $self->session->form->paramsHashRef(); foreach my $field (keys %$forms) { - if $forms->{$field} { + if ($forms->{$field}) { $vars->{"session.form.".$field} = (ref($forms->{$field}) eq 'ARRAY') ?$forms->{$field}[$forms->{$field}[-1]]