No Code Attached Yet
avatar david19161
david19161
15 Nov 2025

STEPS TO REPRODUCE THE ISSUE

Create a Category and add a few articles to it
Create a Menu - Menu Item Type : Articles - Category Blog

Set the Menu - Blog Layout

Leading Articles 0

Intro Articles 0

Links 0

EXPECTED RESULT
I would think this should not even attempt to retrieve any articles from the database

  • note this is not the same as not displaying any articles - which is correct - it does not

ACTUAL RESULT
ALL articles in the assigned category are retrieved from the database - waste of time, they are not going to be displayed

SYSTEM INFORMATION
Joomla 6 default install - no overrides, third-party plugins
php 8.3

ADDITIONAL COMMENTS
The problem seems to stem from the code in here

File : components/com_content/src/Model/CategoryModel.php
Line : 255(ish)
if ($limit >= 0) { <------------------------------------ here, should this not be if ($limit > 0)
$this->_articles = $model->getItems();

if ($this->_articles === false) {
    $this->setError($model->getError());
}

} else {
$this->_articles = [];
}

As it is, this wastes time (a noticeable amount of time if you have many articles) getting ALL articles in the assigned category...to display none
The - lag - when you click on the menu becomes more and more noticeable the more articles you have in the assigned category - (it gets them all)

For a quick way to see how many articles it - got -

File : components/com_content/src/Model/ArticlesModel.php
Function : getItems()

add the following line to the end of the function getItems() before : return $items
echo count($items);

avatar david19161 david19161 - open - 15 Nov 2025
avatar david19161 david19161 - change - 15 Nov 2025
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 15 Nov 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 15 Nov 2025
avatar alikon
alikon - comment - 16 Nov 2025

same as #18529

Add a Comment

Login with GitHub to post a comment