Skip to content

[J5] All articles data is loaded in Category Menu when 0 articles are set to be displayed - performance impact #18529

@AndySDH

Description

@AndySDH

POST UPDATED TO JOOMLA 5

Steps to reproduce the issue

  • Have a category with many articles (hundreds? the more the better to see the performance impact. for this example I'll use a random number of 432 articles)
  • Create a Category Blog Menu Item of that category, but in "Blog Layout" options set 0 articles to display in all four inputs.
  • Visit this menu item in the frontend.

Expected result

I would expect the page to load super fast because there is no article data to load whatsoever.

Actual result

The loading is VERY SLOW, taking dozens of seconds, if not minutes, depending on the amount of articles and content within those articles. Why? Because Joomla is loading in the background the data from ALL those 432 articles as if they were all displayed at the same time in that one page with no pagination, despite the fact you're actually displaying 0!

Additional comments

Still happening as of Joomla 5

Additional comments

To top it off, obviously, if in the options you put to only display "1" article, of course it loads super fast because it only loads 1 article, correctly. You put "20" articles? It displays quite fast because it only loads 20 articles, correctly. You put "0" articles? It loads incredibly slow because it loads all 432 articles in the background (and then showing 0 at the end of the loading). This can't be intended behavior.

In an old comment, someone suggested to put "-1" instead of "0" articles in the Menu options to work around the problem, and while it worked before, now in Joomla 5 it's no longer possible because it's impossible to save a menu item with a "-1" as the value. So now there is not even a workaround anymore.

PS: You may ask, why would you want to input 0 articles in the first place? Well, it could be useful for cases when you might want to only display the description of the category, or if you want to display the articles via other means (content plugins or modules) and you don't want to display them natively. Plus, the use case shouldn't even matter, it's just a wrong/flawed behavior regardless.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions