Linguica Posted February 21, 2017 Posted February 21, 2017 Beyond being way too slow for any downloads section with a great deal of files and subcategories, the contentCount() method and implementation are broken in at least 2 ways: there is supposed to be a limit to the depth that the method will dive to count items. However, the code $childDepth = $depth++; will never actually increment the counter because it's assigning the old value of $depth each time before incrementing it, i.e., the value always stays at the default. It should use ++$depth or just $depth + 1. Even if the method worked correctly, it still would not display on the category listing sidebar, because the PHTML includes code like {number="\IPS\downloads\File::contentCount( $category )"} which attempts to forcibly convert the value to a number. However, if the method returns "123+" or something similar, this just gets changed to 0. It should be interpreted as an expression, not a number.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.