diff --git a/docs/changelog/6.x.x.txt b/docs/changelog/6.x.x.txt index 7f689c384..32ac5d1d7 100644 --- a/docs/changelog/6.x.x.txt +++ b/docs/changelog/6.x.x.txt @@ -7,7 +7,8 @@ over 100% in CGI mode, 10% in mod_perl mode, and less memory usage in mod_perl mode. - Changed the privileges API significantly. See docs/migration.txt for details. - + - Fixed a bug in articles where articles with no content would fail to + display their images. 6.0.3 diff --git a/lib/WebGUI/Navigation.pm b/lib/WebGUI/Navigation.pm index 6ada9f56b..8a826bd08 100644 --- a/lib/WebGUI/Navigation.pm +++ b/lib/WebGUI/Navigation.pm @@ -105,7 +105,7 @@ sub _levels { my $p = WebGUI::Page->getPage; my @ancestors = reverse $p->ancestors; if(scalar(@ancestors) == 1) { # I am WebGUI root. I have one ancestor, which - return $p # is nameless root. Return myself + return $p; # is nameless root. Return myself } elsif(scalar(@ancestors) > 1) { # I am a page under WebGUI root. return $ancestors[1]; # 1st element of ancestors is WebGUI root } else { diff --git a/lib/WebGUI/Wobject/Article.pm b/lib/WebGUI/Wobject/Article.pm index 55848a720..5c8ca604c 100644 --- a/lib/WebGUI/Wobject/Article.pm +++ b/lib/WebGUI/Wobject/Article.pm @@ -155,17 +155,16 @@ sub www_view { $var{"description.first.2sentences"} =~ s/^((.*?\.){2}).*/$1/s; $var{"description.first.sentence"} = $var{"description.first.2sentences"}; $var{"description.first.sentence"} =~ s/^(.*?\.).*/$1/s; + my $p = WebGUI::Paginator->new(WebGUI::URL::page("wid=".$_[0]->get("wobjectId")."&func=view"),1); if ($session{form}{makePrintable} || $var{description} eq "") { $var{description} =~ s/\^\-\;//g; - $var{isFirstPage} = 1; - $var{isLastPage} = 1; + $p->setDataByArrayRef([$var{description}]); } else { my @pages = split(/\^\-\;/,$var{description}); - my $p = WebGUI::Paginator->new(WebGUI::URL::page("wid=".$_[0]->get("wobjectId")."&func=view"),1); $p->setDataByArrayRef(\@pages); $var{description} = $p->getPage; - $p->appendTemplateVars(\%var); } + $p->appendTemplateVars(\%var); if ($_[0]->get("attachment") ne "") { $file = WebGUI::Attachment->new($_[0]->get("attachment"),$_[0]->get("wobjectId")); $var{"attachment.box"} = $file->box;