Jump to content

Item->contentCount() is broken / use in Downloads is broken


Linguica

Recommended Posts

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:

  1.  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.

  2. 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.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...