RTC PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar AdarshSantoria
AdarshSantoria
1 Apr 2025

Pull Request for Issue #45181

Summary of Changes

This PR fixes a bug where filtering articles by Author = None did not return articles created by deleted users. Joomla previously used created_by = 0 for the "None" filter, but in reality, deleted users leave their created_by values intact in the #__content table — they just no longer exist in the #__users table.

This fix updates the logic to:

  • Detect when the filter is set to 0 (representing "None")
  • Return articles where created_by NOT IN (SELECT id FROM #__users)
  • Support multi-select filters, e.g. author_id = [0, 42], to include both deleted users and existing ones

This PR is a continuation and enhancement of #45186, extending support to "by_me" and fixing edge cases in combined filters.


Testing Instructions

  1. Create two users in Joomla.
  2. Create articles using each user.
  3. Delete one of the users via Users > Manage.
  4. Go to Content > Articles.
  5. Apply the Author filter:
    • Select "None" → should show article by deleted user ✅
    • Select deleted user + another existing user → both articles show ✅
    • Select only existing user → shows only that user’s articles ✅

Actual result BEFORE applying this Pull Request

Screenshot (9)

  • Filtering by Author = None shows no articles.
  • Deleted users are not handled properly in the query.
  • created_by = 0 was used incorrectly.

Expected result AFTER applying this Pull Request

Screenshot (10)

  • Articles created by deleted users appear when Author = None is selected.
  • Query uses created_by NOT IN (SELECT id FROM #__users) for deleted users.
  • Filtering works as expected for mixed author selections (deleted + existing).

Screenshot (24)

  • Articles created by the current user appear when Author = Created by me is selected.
  • The 'Created by me' filter is correctly replaced with the logged-in user's ID.
  • Deleted users are no longer incorrectly included.
  • Filtering works as expected for combinations like ["by_me"].

Link to documentation

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

avatar AdarshSantoria AdarshSantoria - open - 1 Apr 2025
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2025
Category Administration com_content
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
The description was changed
avatar AdarshSantoria AdarshSantoria - edited - 1 Apr 2025
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
The description was changed
avatar AdarshSantoria AdarshSantoria - edited - 1 Apr 2025
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Labels Added: PR-5.3-dev PR-5.4-dev
avatar richard67
richard67 - comment - 1 Apr 2025

@AdarshSantoria Could you extend the testing instructions by a test case for the "Created by me" filter? Thanks in advance.

avatar AdarshSantoria
AdarshSantoria - comment - 1 Apr 2025

@AdarshSantoria Could you extend the testing instructions by a test case for the "Created by me" filter? Thanks in advance.

Thanks for the suggestion. I will add the "Created by me" test case to the instructions.

avatar AdarshSantoria
AdarshSantoria - comment - 1 Apr 2025

✅ Additional Test Cases for Author Filter

This extends the original test coverage for the "Created by me" filters using the following setup:

  • Owner (main/logged-in user, i.e., me)
  • Owner with Admin (another user)
  • Owner with a deleted user

1. Created by me

  • Logged in as Owner
  • Apply the Author filter:
    • Select "Created by me" → ✅ Only article with author Owner is shown.
      Screenshot (25)

2. Created by me + Admin

  • Apply the Author filter:
    • Select "Created by me" + "Admin" → ✅ Articles with authors Owner and Admin are shown.
      Screenshot (27)

3. None (Deleted User)

  • Delete the user who created the third article
  • Apply the Author filter:
    • Select "Created by me" + "None" → ✅ Article with authors Owner and [Deleted User] is shown.
      Screenshot (26)
avatar richard67
richard67 - comment - 1 Apr 2025

@brianteeman @fgsw Could you test this PR, too? Thanks in advance.

avatar brianteeman brianteeman - test_item - 1 Apr 2025 - Tested successfully
avatar brianteeman
brianteeman - comment - 1 Apr 2025

I have tested this item ✅ successfully on c8faaf9


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

avatar fgsw fgsw - test_item - 3 Apr 2025 - Tested successfully
avatar fgsw
fgsw - comment - 3 Apr 2025

I have tested this item ✅ successfully on c8faaf9


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

avatar richard67 richard67 - change - 3 Apr 2025
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 3 Apr 2025

RTC


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

avatar richard67 richard67 - test_item - 13 Apr 2025 - Tested successfully
avatar richard67
richard67 - comment - 13 Apr 2025

I have tested this item ✅ successfully on c8faaf9

Not sure if previous human tests were also made with PostgreSQL, so I've just tested that.


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

avatar richard67 richard67 - change - 13 Apr 2025
Labels Added: RTC
Removed: PR-5.3-dev
avatar richard67 richard67 - close - 13 Apr 2025
avatar richard67 richard67 - merge - 13 Apr 2025
avatar richard67 richard67 - change - 13 Apr 2025
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2025-04-13 13:07:59
Closed_By richard67
avatar richard67
richard67 - comment - 13 Apr 2025

Thanks all (author and testers).

Add a Comment

Login with GitHub to post a comment