fixing upgrade bug

This commit is contained in:
JT Smith 2005-12-07 18:57:36 +00:00
parent 0a92929472
commit 466c6ac357
3 changed files with 10 additions and 10 deletions

View file

@ -36,7 +36,6 @@ sub updateProfileSystem {
WebGUI::SQL->write("alter table userProfileField change fieldLabel label varchar(255) not null default 'Undefined'"); WebGUI::SQL->write("alter table userProfileField change fieldLabel label varchar(255) not null default 'Undefined'");
WebGUI::SQL->write("alter table userProfileField change dataType fieldType varchar(128) not null default 'text'"); WebGUI::SQL->write("alter table userProfileField change dataType fieldType varchar(128) not null default 'text'");
WebGUI::SQL->write("alter table userProfileField change dataValues possibleValues text"); WebGUI::SQL->write("alter table userProfileField change dataValues possibleValues text");
WebGUI::SQL->write("alter table userProfileField change dataDefault defaultValue text");
WebGUI::SQL->write("alter table userProfileCategory change categoryName label varchar(255) not null default 'Undefined'"); WebGUI::SQL->write("alter table userProfileCategory change categoryName label varchar(255) not null default 'Undefined'");
} }

View file

@ -189,7 +189,7 @@ sub fatal {
} else { } else {
print "<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n"; print "<h1>WebGUI Fatal Error</h1><p>Something unexpected happened that caused this system to fault.</p>\n";
print "<p>".$message."</p>\n"; print "<p>".$message."</p>\n";
print showDebug(); print showDebug() if (canShowDebug());
} }
WebGUI::Session::close(); WebGUI::Session::close();
exit; exit;
@ -206,7 +206,8 @@ Returns a reference to the logger.
sub getLogger { sub getLogger {
unless (Log::Log4perl->initialized()) { unless (Log::Log4perl->initialized()) {
Log::Log4perl->init( $WebGUI::Session::session{config}{webguiRoot}."/etc/log.conf" ); #Log::Log4perl->init( $WebGUI::Session::session{config}{webguiRoot}."/etc/log.conf" );
Log::Log4perl->init( "/data/WebGUI/etc/log.conf" );
} }
return Log::Log4perl->get_logger($WebGUI::Session::session{config}{configFile}); return Log::Log4perl->get_logger($WebGUI::Session::session{config}{configFile});
} }
@ -232,7 +233,7 @@ sub getSessionVars {
} elsif (ref $value eq 'HASH') { } elsif (ref $value eq 'HASH') {
$value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}'; $value = '{'.join(', ',map {"$_ => $value->{$_}"} keys %$value).'}';
} }
unless (lc($key) eq "password" || lc($key) eq "identifier") { unless (lc($key) eq "password" || lc($key) eq "identifier" || lc($key) eq "dbpass") {
$data .= "\t".$section.'.'.$key.' = '.$value."\n"; $data .= "\t".$section.'.'.$key.' = '.$value."\n";
} }
} }

View file

@ -400,7 +400,7 @@ A scalar indicating the type of field this will be when generated as a form elem
A scalar containing a hash reference declaration of possible values. Only used for list type fields. A scalar containing a hash reference declaration of possible values. Only used for list type fields.
=head4 defaultValue =head4 dataDefault
A scalar containing an array reference or scalar declaration of defaultly selected value(s). A scalar containing an array reference or scalar declaration of defaultly selected value(s).
@ -415,12 +415,12 @@ sub set {
$properties->{required} = 0 unless ($properties->{required} == 1); $properties->{required} = 0 unless ($properties->{required} == 1);
$properties->{label} = 'Undefined' if ($properties->{label} =~ /^[\"\']*$/); $properties->{label} = 'Undefined' if ($properties->{label} =~ /^[\"\']*$/);
$properties->{fieldType} = 'text' unless ($properties->{fieldType}); $properties->{fieldType} = 'text' unless ($properties->{fieldType});
if ($properties->{defaultValue} && $properties->{fieldType}=~/List$/) { if ($properties->{dataDefault} && $properties->{fieldType}=~/List$/) {
unless ($properties->{defaultValue} =~ /^\[/) { unless ($properties->{dataDefault} =~ /^\[/) {
$properties->{defaultValue} = "[".$properties->{defaultValue}; $properties->{dataDefault} = "[".$properties->{dataDefault};
} }
unless ($properties->{defaultValue} =~ /\]$/) { unless ($properties->{dataDefault} =~ /\]$/) {
$properties->{defaultValue} .= "]"; $properties->{dataDefault} .= "]";
} }
} }
$properties->{fieldName} = $self->getId; $properties->{fieldName} = $self->getId;