Skip to content

Conversation

@joomdonation
Copy link
Contributor

Pull Request for Issue #46447, #18529 .

Summary of Changes

At the moment, for Category Blog menu item type, Joomla still loads articles if total number of articles configured for that menu item = 0. This PR just fixed that wrong behavior, see the linked issues to understand more details

Testing Instructions

  • Create two menu items, one links to Category Blog Layout menu item type and one to Category List menu item type.
  • Apply patch, confirm that two menu items still display articles same as before.
  • We will also needs confirmation from the author of the two issues confirm that the issue fixed

Actual result BEFORE applying this Pull Request

Works, but Joomla still query database to get articles when it is not needed, thus cause potential performance issue

Expected result AFTER applying this Pull Request

Works, no unnecessary query executed anymore if the menu item is configured to not show any articles

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

The problem is that in other areas setting to 0 means all articles eg in mod_articles

image

@AndySDH
Copy link
Contributor

AndySDH commented Dec 6, 2025

@brianteeman That's not a problem. The issue of this PR is tied to the Category Menu Item. The issue resides on the fact that, when putting 0 on all article fields in the Category Menu Item, it will display 0 articles (this is already the case, so no inconsistency here, it already always worked like this) but it still queries in the background the data from all articles, causing super slow loading despite showing the intended 0 articles at the end.

@joomdonation Thanks, I'll test this and report back.

@AndySDH
Copy link
Contributor

AndySDH commented Dec 6, 2025

I have tested this item ✅ successfully on 675eb71

Thank you, after over 8 years, I confirm this fixes the issue :D


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46542.

@brianteeman
Copy link
Contributor

Sorry you missed the point I was trying to make. In the module 0 = everything but in the component 0= nothing

@AndySDH
Copy link
Contributor

AndySDH commented Dec 6, 2025

Sorry you missed the point I was trying to make. In the module 0 = everything but in the component 0= nothing

No, I perfectly got your point. But your point has nothing to do with this PR or the issue is trying to fix.

@brianteeman
Copy link
Contributor

Fair enough

@exlemor
Copy link

exlemor commented Dec 6, 2025

I have tested this item ✅ successfully on 675eb71

I have tested this successfully. Thanks @joomdonation.

I turned on Debug, I had expected to see fewer queries but I got the same amount with or without the PR:
15 statements were executed, 2 of which were duplicates, 13 unique

(I assume that's fine, just thought I'd mention it just in case).


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46542.

@joomdonation
Copy link
Contributor Author

I turned on Debug, I had expected to see fewer queries but I got the same amount with or without the PR:

Yes. The queries should be fewer because we do not have to query database to get articles data. In my sample setup, before the change, there is 51 queries. After the change, only 42 queries (but my local site contains mix of things, not just fresh Joomla installation

@joomdonation
Copy link
Contributor Author

joomdonation commented Dec 7, 2025

@AndySDH @exlemor I made change to potential potential backward-compatibility breaks when certain extensions (modules, plugins) use Category model in blog category layout. I could not see anything from Joomla core, but want to be safe. Could you re-test? Thanks !

@AndySDH
Copy link
Contributor

AndySDH commented Dec 7, 2025

I have tested this item ✅ successfully on b6b868c

Confirm it still works after the new update.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46542.

@exlemor
Copy link

exlemor commented Dec 8, 2025

I have tested this item ✅ successfully on b6b868c

I have re-tested this successfully. Thanks for your due diligence @joomdonation

In my case, still the same results BEFORE and AFTER applying the PR and clearing cache.
15 statements were executed, 2 of which were duplicates, 13 unique


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46542.

@richard67
Copy link
Member

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/46542.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Dec 8, 2025
@muhme
Copy link
Contributor

muhme commented Dec 8, 2025

✅ Final test before merge with JBT (which has 'Debug System' and 'Log Almost Everything' on by default)

  • Installed Testing Sample Data
  • With 'Category Blog'
    • Used category 'Joomla!' (with subcategory Extensions)
      • 32 statements were executed, 5 of which were duplicates, 27 unique
    • Applied PR with gh pr checkout 46542
      • 27 statements were executed, 3 of which were duplicates, 24 unique
    • Tested only 1 leading, only 1 intro, only 1 link and with the global settings; compared each result with before PR in using git switch -
  • With 'Category List' before and after PR with the same result

@muhme muhme merged commit bb8d2c0 into joomla:5.4-dev Dec 8, 2025
61 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Dec 8, 2025
@muhme muhme added this to the Joomla! 5.4.2 milestone Dec 8, 2025
@muhme
Copy link
Contributor

muhme commented Dec 8, 2025

Thank you @joomdonation for your contribution. Thank you @brianteeman for supporting. Thank you @AndySDH and @exlemor for the repeated testing.

@joomdonation
Copy link
Contributor Author

Thanks to all :). And congratulate @AndySDH finally have the issue fixed :D

@joomdonation joomdonation deleted the fix_category_blog_zero_articles branch December 9, 2025 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants