X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=blobdiff_plain;f=includes%2FCategoryViewer.php;h=f7490033d456897991a8d7ce285d57f800297ed7;hb=e3bd13db0c285f312e31bb1b7271af4628cca80c;hp=b912603611421f904096198bc6197c4d3d92439d;hpb=9ba3fca2d8adc56787c8efc32c41424cb212e387;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 .= "