PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar wakqasahmed
wakqasahmed
14 Sep 2026

Pull Request resolves #47797.

  • I read the Generative AI policy and my contribution is either not created with the help of AI or is compatible with the policy and GNU/GPL 2 or later.

Summary of Changes

With System Cache set to Conservative or Progressive, com_content's category view caches its output keyed only by a whitelist of "safe" URL parameters (Cache::makeId() in libraries/src/Cache/Cache.php, fed by $app->registeredurlparams). com_content's DisplayController registers catid, filter, filter_order, etc. as safe params, but never filter_tag — so a request for ?filter_tag=2 gets served whatever was cached for that category first, tag filter or not, since the cache ID doesn't change when the tag changes.

Added filter_tag (as INT, matching how both CategoryModel and ArticlesModel already read it) to the $safeurlparams array in components/com_content/src/Controller/DisplayController.php, so the tag filter is now part of the cache key.

Testing Instructions

I traced this by reading the actual cache-key code (ViewController::_makeId() → Cache::makeId()) rather than assuming from the issue description, and confirmed the whitelist is the only thing that determines what varies the cache ID. I didn't add an automated test — this is a single-entry addition to a static safe-URL-parameter list, and exercising it end-to-end would need a full running Joomla install with page/view caching enabled (this repo's existing coverage for that is Cypress system tests against a live instance, not something a unit test can reach). Manual verification matches the reporter's own repro:

  1. Global Configuration > System > Cache: set to Conservative Caching.
  2. Open a category blog page whose articles use tags.
  3. Visit it once with ?filter_tag=1, then again with ?filter_tag=2 (or vice versa) — before this fix, the second request returns the same cached HTML as the first; after the fix, each tag value gets its own cache entry and the filter is respected.

Actual result BEFORE applying this Pull Request

Tag filter is ignored on cached category pages — whichever tag was requested first gets served for all subsequent tag values until the cache expires.

Expected result AFTER applying this Pull Request

Each filter_tag value gets its own cache entry, so the category page correctly reflects the requested tag filter even with caching enabled.

Link to documentations

Please select:

  • Documentation link for guide.joomla.org:

  • No documentation changes for guide.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed


(Rebased onto current 5.4-dev from #48445, which had fallen behind; same commit content.)

avatar wakqasahmed wakqasahmed - open - 14 Sep 2026
avatar wakqasahmed wakqasahmed - change - 14 Sep 2026
Status New ⇒ Pending
avatar joomla-cms-bot joomla-cms-bot - change - 14 Sep 2026
Category ⇒ Front End com_content
avatar richard67 richard67 - change - 15 Sep 2026
Title
…
[AI] Fix tag filter ignored on cached category pages (#47797)
[5.4] [AI] Fix tag filter ignored on cached category pages (#47797)
avatar richard67 richard67 - edited - 15 Sep 2026
avatar joomdonation
joomdonation - comment - 18 Sep 2026

Visit it once with ?filter_tag=1, then again with ?filter_tag=2 (or vice versa) — before this fix, the second request returns the same cached HTML as the first; after the fix, each tag value gets its own cache entry and the filter is respected.

Users should test it by doing something on the page (for example, select a tag), not by change variable directly on URL as you describe.

From what I see, the filter_tag input is only used on Category List menu item type when Filter Field parameter in the menu item set to Tags. And for that operation, we do not allow caching view output, see the code https://github.com/joomla/joomla-cms/blob/5.4-dev/components/com_content/src/Controller/DisplayController.php#L81-L87 , so the change you made here is useless.

avatar wakqasahmed
wakqasahmed - comment - 19 Sep 2026

You're right, and I should have traced this further before opening the PR. The tag-filter select on the Category List view (tmpl/category/default_articles.php) lives inside a real <form method="post">, submitted via a button, not auto-submitted or GET. That POST request has vName='category' with layout='default' (not blog), which hits the existing cache-disable condition at DisplayController.php:81-87 before $safeurlparams/filter_tag is ever consulted. So the fix here has no effect on the real, reachable path — the collision I reported only reproduces by editing the URL directly as a GET request, which isn't how this control is actually used. Closing this out.

avatar wakqasahmed wakqasahmed - change - 19 Sep 2026
Status Pending ⇒ Closed
Closed_Date 0000-00-00 00:00:00 ⇒ 2026-09-19 04:06:05
Closed_By ⇒ wakqasahmed
Labels Added: bug PR-5.4-dev
avatar wakqasahmed wakqasahmed - close - 19 Sep 2026
avatar richard67
richard67 - comment - 19 Sep 2026

@joomdonation Should the corresponding issue be closed, too?

avatar brianteeman
brianteeman - comment - 19 Sep 2026

what about extensions - surely they can have this problem

avatar joomdonation joomdonation - change - 19 Sep 2026
Status Closed ⇒ New
Closed_Date 2026-09-19 04:06:05 ⇒
Closed_By wakqasahmed ⇒
Labels Removed: bug
avatar joomdonation joomdonation - change - 19 Sep 2026
Status New ⇒ Pending
avatar joomdonation joomdonation - reopen - 19 Sep 2026
avatar joomdonation
joomdonation - comment - 19 Sep 2026

Sorry my bad. Check it more carefully, I see that tags can be selected at Category Blog layout, so this PR appears to be valid

avatar wakqasahmed
wakqasahmed - comment - 19 Sep 2026

Thanks for taking a second look — glad it's not actually dead code. To close the loop on my last comment: I was wrong to retract, I'd only traced the Category List / Filter Field=Tags path and missed that Category Blog also exposes the tag filter and hits the same cache key. Leaving this open, no changes needed to the diff itself.

@brianteeman on extensions — this PR only touches core's com_content cache-key whitelist, so it can't fix a third-party extension's own caching logic, but any extension that reuses com_content's category view (rather than rolling its own controller) would pick up the same fix for free once this lands.

avatar brianteeman
brianteeman - comment - 19 Sep 2026

My comment was more to @joomdonation as there are extensions that add filtering etc

avatar muhme muhme - test_item - 8 Oct 2026 - Tested unsuccessfully
avatar muhme
muhme - comment - 8 Oct 2026

I have tested this item 🔴 unsuccessfully on 3cc89fc

Tested with JBT

  • Using scripts/memcached 54 on and installed Blog sample data
  • Created two Blog category articles, one with Millions (2) tag and one with Love/Joomla (5) tag
  • Before PR seen index.php/blog?filter_tag=2 and index.php/blog?filter_tag=5 get the same result,
    depending on first call and until cache is cleared
  • Applied PR with Patch Tester
    • ✅ All tagged articles are shown with filter_tag parameter w/o the need to clean cache
    • ✅ filter_tag=42 shows correct 'There are no articles in this category. ...'
    • ❌ index.php/blog w/o filter_tag still depends on cache,
      if filter_tag=2 was used first the article tagged Millions is used and
      if filter_tag=5 was used first the article tagged with Love/Joomla is used w/o filter_tag parameter
      (this is the same behaviour as before PR)
  • With 'OFF - Caching disabled' and w/ or w/o PR
    • ⚠️ index.php/blog depends on previous used filter_tag parameter, even w/ full page reload
    • ⚠️ index.php/blog never shows me all Category Blog articles

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48459.
avatar muhme
muhme - comment - 8 Oct 2026

I have tested this item 🔴 unsuccessfully on 3cc89fc

Tested with JBT

  • Using scripts/memcached 54 on and installed Blog sample data
  • Created two Blog category articles, one with Millions (2) tag and one with Love/Joomla (5) tag
  • Before PR seen index.php/blog?filter_tag=2 and index.php/blog?filter_tag=5 get the same result,
    depending on first call and until cache is cleared
  • Applied PR with Patch Tester
    • ✅ All tagged articles are shown with filter_tag parameter w/o the need to clean cache
    • ✅ filter_tag=42 shows correct 'There are no articles in this category. ...'
    • ❌ index.php/blog w/o filter_tag still depends on cache,
      if filter_tag=2 was used first the article tagged Millions is used and
      if filter_tag=5 was used first the article tagged with Love/Joomla is used w/o filter_tag parameter
      (this is the same behaviour as before PR)
  • With 'OFF - Caching disabled' and w/ or w/o PR
    • ⚠️ index.php/blog depends on previous used filter_tag parameter, even w/ full page reload
    • ⚠️ index.php/blog never shows me all Category Blog articles

This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/48459.
avatar HLeithner
HLeithner - comment - 5 Nov 2026

This pull request has been automatically rebased to 6.2-dev. Joomla! 5.4 is now in security only mode.

avatar richard67 richard67 - change - 6 Nov 2026
Title
…
[5.4] [AI] Fix tag filter ignored on cached category pages (#47797)
[6.2] [AI] Fix tag filter ignored on cached category pages (#47797)
avatar richard67 richard67 - edited - 6 Nov 2026

Add a Comment

Login with GitHub to post a comment