From 67dfefff08cda8424bb0eca6b3e33a4ea01c069a Mon Sep 17 00:00:00 2001 From: JT Smith Date: Tue, 31 Oct 2006 23:34:55 +0000 Subject: [PATCH] merging 7.1.3 changes --- docs/gotcha.txt | 3 ++- lib/WebGUI/Asset/Wobject/Collaboration.pm | 7 ++++--- lib/WebGUI/Group.pm | 17 ++++++++++------- lib/WebGUI/Session/Scratch.pm | 8 ++++---- 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/gotcha.txt b/docs/gotcha.txt index 14e6b64ad..3786a8534 100644 --- a/docs/gotcha.txt +++ b/docs/gotcha.txt @@ -13,7 +13,8 @@ save you many hours of grief. install Text::Aspell, and any dictionary you like. If you want to use spellchecking you have to setup the dictionaries you want your users to use in the config file. Also you'll have to check the - spellchecker checkbox in the RichEdit asset you're using. + spellchecker checkbox in the RichEdit asset you're using. You'll + also need to install the Locale::US perl module. 7.1.3 -------------------------------------------------------------------- diff --git a/lib/WebGUI/Asset/Wobject/Collaboration.pm b/lib/WebGUI/Asset/Wobject/Collaboration.pm index 4a65a2315..83863b188 100644 --- a/lib/WebGUI/Asset/Wobject/Collaboration.pm +++ b/lib/WebGUI/Asset/Wobject/Collaboration.pm @@ -1081,12 +1081,13 @@ sub www_search { my $self = shift; my $i18n = WebGUI::International->new($self->session, 'Asset_Collaboration'); my %var; + my $query = $self->session->form->process("query","text"); $var{'form.header'} = WebGUI::Form::formHeader($self->session,{action=>$self->getUrl}) .WebGUI::Form::hidden($self->session,{ name=>"func", value=>"search" }) .WebGUI::Form::hidden($self->session,{ name=>"doit", value=>1 }); $var{'query.form'} = WebGUI::Form::text($self->session,{ name=>'query', - value=>$self->session->form->process("query","text") + value=>$query }); $var{'form.search'} = WebGUI::Form::submit($self->session,{value=>$i18n->get(170,'WebGUI')}); $var{'form.footer'} = WebGUI::Form::formFooter($self->session); @@ -1096,11 +1097,11 @@ sub www_search { if ($self->session->form->process("doit")) { my $search = WebGUI::Search->new($self->session); $search->search({ - keywords=>$self->session->form->process("query","text"), + keywords=>$query, lineage=>[$self->get("lineage")], classes=>["WebGUI::Asset::Post", "WebGUI::Asset::Post::Thread"] }); - my $p = $search->getPaginatorResultSet($self->getUrl("func=search;doit=1"), $self->get("threadsPerPage")); + my $p = $search->getPaginatorResultSet($self->getUrl("func=search;doit=1;query=".$query), $self->get("threadsPerPage")); $self->appendPostListTemplateVars(\%var, $p); } return $self->processStyle($self->processTemplate(\%var, $self->get("searchTemplateId"))); diff --git a/lib/WebGUI/Group.pm b/lib/WebGUI/Group.pm index d0604f606..5e75dac84 100755 --- a/lib/WebGUI/Group.pm +++ b/lib/WebGUI/Group.pm @@ -588,15 +588,18 @@ sub getDatabaseUsers { my $query = $self->get("dbQuery"); WebGUI::Macro::process($self->session,\$query); my $sth = $dbh->unconditionalRead($query); - unless ($sth->errorCode < 1) { - $self->session->errorHandler->warn("There was a problem with the database query for group ID $gid."); - } - else { - while(my ($userId)=$sth->array) { - push @dbUsers, $userId; + if (defined $sth) { + unless ($sth->errorCode < 1) { + $self->session->errorHandler->warn("There was a problem with the database query for group ID $gid."); + } else { + while(my ($userId)=$sth->array) { + push @dbUsers, $userId; + } } + $sth->finish; + } else { + $self->session->errorHandler->error("Couldn't process unconditional read for database group with group id $gid."); } - $sth->finish; $dbLink->disconnect; } } diff --git a/lib/WebGUI/Session/Scratch.pm b/lib/WebGUI/Session/Scratch.pm index 17517e6e4..4e93c7851 100644 --- a/lib/WebGUI/Session/Scratch.pm +++ b/lib/WebGUI/Session/Scratch.pm @@ -61,7 +61,7 @@ sub delete { my $name = shift; return undef unless ($name); delete $self->{_data}{$name}; - $self->session->db->write("delete from userSessionScratch where name=? and sessionId=?", [$name, $self->{_sessionId}]); + $self->session->db->write("delete from userSessionScratch where name=? and sessionId=?", [$name, $self->session->getId]); } @@ -76,7 +76,7 @@ Deletes all scratch variables for this session. sub deleteAll { my $self = shift; delete $self->{_data}; - $self->session->db->write("delete from userSessionScratch where sessionId=?", [$self->{_sessionId}]); + $self->session->db->write("delete from userSessionScratch where sessionId=?", [$self->session->getId]); } @@ -175,7 +175,7 @@ sub new { my $class = shift; my $session = shift; my $data = $session->db->buildHashRef("select name,value from userSessionScratch where sessionId=?",[$session->getId]); - bless {_session=>$session,_sessionId=>$session->getId, _data=>$data}, $class; + bless {_session=>$session, _data=>$data}, $class; } @@ -215,7 +215,7 @@ sub set { my $value = shift; return undef unless ($name); $self->{_data}{$name} = $value; - $self->session->db->write("insert into userSessionScratch (sessionId, name, value) values (?,?,?) on duplicate key update value=VALUES(value)", [$self->{_sessionId}, $name, $value]); + $self->session->db->write("insert into userSessionScratch (sessionId, name, value) values (?,?,?) on duplicate key update value=VALUES(value)", [$self->session->getId, $name, $value]); }