From 3ed5a864c5a80430516ceb5f6ea4a806c3b5d173 Mon Sep 17 00:00:00 2001 From: Graham Knop Date: Thu, 30 Aug 2007 14:58:18 +0000 Subject: [PATCH] prevent help index linking to nonexistant docs --- docs/changelog/7.x.x.txt | 2 +- lib/WebGUI/Operation/Help.pm | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 7f61eb98d..22aee34a1 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -1,7 +1,7 @@ 7.4.6 + - Prevent Help index from trying to link to non-existant documentation - fix: can't see the send private message link - 7.4.5 - fix: Apostrophy incorrectly escaped as double quote in some places - Remove Help TOC links diff --git a/lib/WebGUI/Operation/Help.pm b/lib/WebGUI/Operation/Help.pm index 2644392ac..6757dac37 100644 --- a/lib/WebGUI/Operation/Help.pm +++ b/lib/WebGUI/Operation/Help.pm @@ -389,21 +389,20 @@ sub www_viewHelpIndex { return $session->privilege->insufficient() unless canView($session); my $i18n = WebGUI::International->new($session); my @helpIndex; - my $i; my @files = _getHelpFilesList($session,); foreach my $fileSet (@files) { my $namespace = $fileSet->[1]; my $help = _load($session,$namespace); foreach my $key (keys %{$help}) { next if $help->{$key}{private}; - push @helpIndex, [$namespace, $key, - $i18n->get($help->{$key}{title},$namespace)]; - $i++; + my $title = $i18n->get($help->{$key}{title},$namespace); + next unless $title; + push @helpIndex, [$namespace, $key, $title]; } } my $output = '
'; - my $halfway = round($i/2); - $i = 0; + my $halfway = round(@helpIndex / 2); + my $i = 0; @helpIndex = sort { $a->[2] cmp $b->[2] } @helpIndex; foreach my $helpEntry (@helpIndex) { my ($namespace, $id, $title) = @{ $helpEntry };