fixing bugs

This commit is contained in:
JT Smith 2004-07-14 19:50:33 +00:00
parent efbb31b7dc
commit eb95900f16
2 changed files with 9 additions and 3 deletions

View file

@ -447,8 +447,7 @@ sub _buildFilter {
#-------------------------------------------------------------------
sub _getLanguages {
my ($self, $restricted) = @_;
my $international = WebGUI::SQL->buildHashRef("select distinct(IndexedSearch_docInfo.languageId), language.language from IndexedSearch_docInfo, language
where language.languageId = IndexedSearch_docInfo.languageId");
my $international = WebGUI::SQL->buildHashRef("select distinct(languageId) from IndexedSearch_docInfo");
tie my %languages, 'Tie::IxHash';
if ($restricted and $self->get('languages') !~ /any/i) {
$languages{any} = WebGUI::International::get(24,$self->get("namespace"));
@ -467,6 +466,9 @@ sub _getNamespaces {
my %international;
foreach my $wobject (@{$session{config}{wobjects}}){
my $cmd = "WebGUI::Wobject::".$wobject;
my $load = 'use '.$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
my $w = $cmd->new({namespace=>$wobject, wobjectId=>'new'});
$international{$wobject} = $w->name;
}

View file

@ -21,6 +21,7 @@ use WebGUI::SQL;
use WebGUI::URL;
use WebGUI::HTML;
use WebGUI::ErrorHandler;
use WebGUI::Grouping;
use DBIx::FullTextSearch::StopList;
use WebGUI::Utility;
use WebGUI::Session;
@ -192,6 +193,9 @@ sub getDetails {
my (@searchDetails, %namespace);
foreach my $wobject (@{$session{config}{wobjects}}){
my $cmd = "WebGUI::Wobject::".$wobject;
my $load = 'use '.$cmd;
eval($load);
WebGUI::ErrorHandler::warn("Wobject failed to compile: $cmd.".$@) if($@);
my $w = $cmd->new({namespace=>$wobject, wobjectId=>'new'});
$namespace{$wobject} = $w->name;
}
@ -684,7 +688,7 @@ Returns an array reference containing all groupIds of groups the user is in.
sub _getGroups {
my @groups;
foreach my $groupId (WebGUI::SQL->buildArray("select groupId from groups")) {
push(@groups, $groupId) if (WebGUI::Privilege::isInGroup($groupId));
push(@groups, $groupId) if (WebGUI::Grouping::isInGroup($groupId));
}
return \@groups;
}