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
EXPECTED RESULT
I would think this should not even attempt to retrieve any articles from the database
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);
| Labels |
Removed:
?
|
||
| Labels |
Added:
No Code Attached Yet
|
||
same as #18529