Fixed a a settings bug and a poll bug

This commit is contained in:
Martin Kamerbeek 2006-10-31 18:17:06 +00:00
parent 8b706dc727
commit 82bea1825c
4 changed files with 47 additions and 18 deletions

View file

@ -28,6 +28,10 @@
- WebGUI::Session::Stow now warns if set() is called when cache is disabled
- Fixed a bug in the LDAP auth module where LDAP links could not connect to
the LDAP server (Martin Kamerbeek / Procolix)
- Fixed a bug where the Automatic LDAP Registration setting could not be set.
(Martin Kamerbeek / Procolix)
- Fixed a bug in the Poll where using graphs could result in errors. See
gotcha.txt for details. (Martin Kamerbeek / Procolix)
7.1.2
- Fixed a bug where logging in/out would cause a blank page display.

View file

@ -15,7 +15,15 @@ save you many hours of grief.
users to use in the config file. Also you'll have to check the
spellchecker checkbox in the RichEdit asset you're using.
7.1.3
--------------------------------------------------------------------
* The column that stores the graph configuration in the Poll table
has the wrong type. In MySQL 5 this results in corrpution of this
hash. The upgrade script will fix the column type, but not the
corrupted graph configs. Polls with an erroneous configuration
will diplay the old text based graphs. To fix the Polls, just edit
them, set the correct graphing options again and finally save.
7.0.8
--------------------------------------------------------------------
* 7.0.7 was released with a critical bug that broke the search engine

View file

@ -20,19 +20,31 @@ my $quiet; # this line required
my $session = start(); # this line required
# upgrade functions go here
insertAutomaticLDAPRegistrationSetting($session);
changeGraphConfigColumnType($session);
finish($session); # this line required
##-------------------------------------------------
#sub exampleFunction {
# my $session = shift;
# print "\tWe're doing some stuff here that you should know about.\n" unless ($quiet);
# # and here's our code
#}
#-------------------------------------------------
sub insertAutomaticLDAPRegistrationSetting {
my $session = shift;
print "\tAdding Automatic LDAP Registration setting to database.\n" unless ($quiet);
my ($hasSetting) = $session->db->quickArray('select name from settings where value=?', ['automaticLDAPRegistration']);
unless ($hasSetting) {
$session->db->write('insert into settings (name, value) values (?,?)', ['automaticLDAPRegistration', 0]);
}
}
#-------------------------------------------------
sub changeGraphConfigColumnType {
my $session = shift;
print "\tFixing the the charts in the Poll asset (PLEASE SEE NOTES IN docs/gotcha.txt).\n" unless ($quiet);
$session->db->write('alter table Poll change column graphConfiguration graphConfiguration blob');
}
# ---- DO NOT EDIT BELOW THIS LINE ----

View file

@ -20,6 +20,7 @@ use WebGUI::Utility;
use WebGUI::Asset::Wobject;
use WebGUI::Image::Graph;
use WebGUI::Storage::Image;
use Storable;
our @ISA = qw(WebGUI::Asset::Wobject);
@ -388,19 +389,23 @@ sub view {
my $config = {};
if ($self->get('graphConfiguration')) {
$config = Storable::thaw($self->get('graphConfiguration'));
my $graph = WebGUI::Image::Graph->loadByConfiguration($self->session, $config);
$graph->addDataset(\@dataset);
$graph->setLabels(\@labels);
$graph->draw;
if ($config) {
my $graph = WebGUI::Image::Graph->loadByConfiguration($self->session, $config);
$graph->addDataset(\@dataset);
$graph->setLabels(\@labels);
my $storage = WebGUI::Storage::Image->createTemp($self->session);
my $filename = 'poll'.$self->session->id->generate.".png";
$graph->saveToStorageLocation($storage, $filename);
$graph->draw;
$var{graphUrl} = $storage->getUrl($filename);
$var{hasImageGraph} = 1;
my $storage = WebGUI::Storage::Image->createTemp($self->session);
my $filename = 'poll'.$self->session->id->generate.".png";
$graph->saveToStorageLocation($storage, $filename);
$var{graphUrl} = $storage->getUrl($filename);
$var{hasImageGraph} = 1;
} else {
$self->session->errorHandler->error('The graph configuration hash of the Poll ('.$self->getUrl.') is corrupt.');
}
}
}