From faa9e24344325c7a68fa45d9380d16e2cd2903cd Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Mon, 6 Oct 2008 15:55:32 +0000 Subject: [PATCH] fixed: Search asset shows blank page after searching --- docs/changelog/7.x.x.txt | 1 + lib/WebGUI/Asset/Wobject/Search.pm | 14 +++++++------- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index e1fd7d004..421af7aeb 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -21,6 +21,7 @@ - fixed: Combo box does not show possible values in Thingy (SDH Consulting Group) - fixed: Cross site scripting issue on operation pages + - fixed: Search asset shows blank page after searching 7.6.0 - added: users may now customize the post received page for the CS diff --git a/lib/WebGUI/Asset/Wobject/Search.pm b/lib/WebGUI/Asset/Wobject/Search.pm index e6550d58e..d7049a3e2 100644 --- a/lib/WebGUI/Asset/Wobject/Search.pm +++ b/lib/WebGUI/Asset/Wobject/Search.pm @@ -180,7 +180,7 @@ sub view { #Instantiate the highlighter my @words = split(/\s+/,$keywords); my @wildcards = map { "%" } @words; - my $hl = new HTML::Highlight ( + my $hl = HTML::Highlight->new( words => \@words, wildcards => \@wildcards ); @@ -189,10 +189,10 @@ sub view { my $p = $search->getPaginatorResultSet ( $self->getUrl('doit=1;keywords='.$session->url->escape($keywords)) ); - - my @results = (); - foreach my $data (@{$p->getPageData}) { - next unless ( + + my @results = (); + foreach my $data (@{$p->getPageData}) { + next unless ( $user->userId eq $data->{ownerUserId} || $user->isInGroup($data->{groupIdView}) || $user->isInGroup($data->{groupIdEdit}) @@ -205,9 +205,9 @@ sub view { $properties->{url} = $asset->getContainer->get("url"); } #Add highlighting - $properties->{'title' } = $hl->highlight($properties->{title}); + $properties->{'title' } = $hl->highlight($properties->{title} || ''); $properties->{'title_nohighlight' } = $properties->{title}; - $properties->{'synopsis' } = $hl->highlight($properties->{synopsis}); + $properties->{'synopsis' } = $hl->highlight($properties->{synopsis} || ''); $properties->{'synopsis_nohighlight'} = $properties->{synopsis}; push(@results, $properties); $var{results_found} = 1;