X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=f7490033d456897991a8d7ce285d57f800297ed7;hb=d7bad7704f67dc887a77e4de7581931b7915d04b;hp=b912603611421f904096198bc6197c4d3d92439d;hpb=6e9b4f0e9ce4ccd6089c18b205065ef7fa077484;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/CategoryViewer.php b/includes/CategoryViewer.php index b912603611..f7490033d4 100644 --- a/includes/CategoryViewer.php +++ b/includes/CategoryViewer.php @@ -387,6 +387,7 @@ class CategoryViewer extends ContextSource { $r = ''; $rescnt = count( $this->children ); $dbcnt = $this->cat->getSubcatCount(); + // This function should be called even if the result isn't used, it has side-effects $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'subcat' ); if ( $rescnt > 0 ) { @@ -417,6 +418,7 @@ class CategoryViewer extends ContextSource { $dbcnt = $this->cat->getPageCount() - $this->cat->getSubcatCount() - $this->cat->getFileCount(); $rescnt = count( $this->articles ); + // This function should be called even if the result isn't used, it has side-effects $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'article' ); if ( $rescnt > 0 ) { @@ -437,10 +439,11 @@ class CategoryViewer extends ContextSource { function getImageSection() { $r = ''; $rescnt = $this->showGallery ? $this->gallery->count() : count( $this->imgsNoGallery ); - if ( $rescnt > 0 ) { - $dbcnt = $this->cat->getFileCount(); - $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' ); + $dbcnt = $this->cat->getFileCount(); + // This function should be called even if the result isn't used, it has side-effects + $countmsg = $this->getCountMessage( $rescnt, $dbcnt, 'file' ); + if ( $rescnt > 0 ) { $r .= "
\n"; $r .= '

' . $this->msg(