Это баг.
Напишите в поддержку IPS.
system/Content/Item.php
/**
* Total item \count(including children)
*
* @param \IPS\Node\Model $container The container
* @param bool $includeItems If TRUE, items will be included (this should usually be true)
* @param bool $includeComments If TRUE, comments will be included
* @param bool $includeReviews If TRUE, reviews will be included
* @param int $depth Used to keep track of current depth to avoid going too deep
* @return int|NULL|string When depth exceeds 10, will return "NULL" and initial call will return something like "100+"
* @note This method may return something like "100+" if it has lots of children to avoid exahusting memory. It is intended only for display use
* @note This method includes counts of hidden and unapproved content items as well
*/
public static function contentCount( \IPS\Node\Model $container, $includeItems=TRUE, $includeComments=FALSE, $includeReviews=FALSE, $depth=0 )
1.
/* Add Children */
$childDepth = $depth++;
foreach ( $container->children() as $child )
{
$toAdd = static::contentCount( $child, $includeItems, $includeComments, $includeReviews, $childDepth );
$childDepth здесь не увеличивается на единицу, что должно быть по задумке. См. документацию https://www.php.net/manual/en/language.operators.increment.php
$childDepth = $depth++;
заменить на
$childDepth = ++$depth;
или на
$childDepth = $depth + 1;
2. В шаблоне categoriesSidebar
{number="\IPS\downloads\File::contentCount( $category )"}
и подобные конструкции.
Используется плагин number, но метод может возвращать строку. Поэтому логичнее использовать expression