Language Change PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar AdarshSantoria
AdarshSantoria
22 Mar 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

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).

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 - 22 Mar 2025
avatar AdarshSantoria AdarshSantoria - change - 22 Mar 2025
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Mar 2025
Category Administration com_content
avatar fgsw
fgsw - comment - 22 Mar 2025

@AdarshSantoria Please delete "Fix #45181 - " from the title.

The title say [5.3], but the label is PR-5.2-dev.

avatar AdarshSantoria AdarshSantoria - change - 22 Mar 2025
Title
[5.3] Fix #45181 - Author Filter Now Supports Deleted Users
[5.3] Author Filter Now Supports Deleted Users
avatar AdarshSantoria AdarshSantoria - edited - 22 Mar 2025
avatar AdarshSantoria AdarshSantoria - change - 22 Mar 2025
Labels Added: PR-5.2-dev
avatar brianteeman brianteeman - test_item - 22 Mar 2025 - Tested successfully
avatar brianteeman
brianteeman - comment - 22 Mar 2025

I have tested this item ✅ successfully on 66cd254


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

avatar AdarshSantoria
AdarshSantoria - comment - 22 Mar 2025

Thank you for your feedbacks, @fgsw @brianteeman.

avatar brianteeman
brianteeman - comment - 22 Mar 2025

great work!!

avatar fgsw fgsw - test_item - 22 Mar 2025 - Tested successfully
avatar fgsw
fgsw - comment - 22 Mar 2025

I have tested this item ✅ successfully on 66cd254

Before PR

No deleted user

without1

One deleted user

without2

After PR

One deleted user

with1

Three deleted user

with2


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/45186.
avatar richard67 richard67 - change - 22 Mar 2025
Status Pending Ready to Commit
Build 5.2-dev 5.3-dev
avatar richard67
richard67 - comment - 22 Mar 2025

RTC


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

avatar bembelimen
bembelimen - comment - 25 Mar 2025

Good work with this PR, really like it, just found a minor thing you probably could fix.

avatar AdarshSantoria AdarshSantoria - change - 26 Mar 2025
Labels Added: RTC PR-5.3-dev
Removed: PR-5.2-dev
avatar richard67 richard67 - change - 26 Mar 2025
Title
[5.3] Author Filter Now Supports Deleted Users
[5.4] Author Filter Now Supports Deleted Users
avatar richard67 richard67 - edited - 26 Mar 2025
avatar richard67
richard67 - comment - 26 Mar 2025

As agreed today in the maintainers meeting, I've rebased this PR to 5.4-dev.

avatar richard67 richard67 - change - 26 Mar 2025
Labels Added: PR-5.4-dev
avatar richard67 richard67 - test_item - 30 Mar 2025 - Tested unsuccessfully
avatar richard67
richard67 - comment - 30 Mar 2025

I have tested this item 🔴 unsuccessfully on 93ba616

The PR works as described. However, it breaks the filtering option "Created by me". When this PR is applied and the "Created by me" filtering option is selected, the articles list shows the articles of deleted users in addition to the articles created by me.


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

avatar richard67 richard67 - alter_testresult - 30 Mar 2025 - brianteeman: Tested successfully
avatar richard67 richard67 - alter_testresult - 30 Mar 2025 - fgsw: Tested successfully
avatar richard67 richard67 - change - 30 Mar 2025
Status Ready to Commit Pending
avatar richard67
richard67 - comment - 30 Mar 2025

Back to pending due to unsuccessful human test.


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

avatar AdarshSantoria
AdarshSantoria - comment - 30 Mar 2025

I have tested this item 🔴 unsuccessfully on 93ba616The PR works as described. However, it breaks the filtering option "Created by me". When this PR is applied and the "Created by me" filtering option is selected, the articles list shows the articles of deleted users in addition to the articles created by me.

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

Thank you for your feedback, I will try to fix this.

avatar richard67
richard67 - comment - 30 Mar 2025

Thank you for your feedback, I will try to fix this.

@AdarshSantoria It might be that there is no error in your PR but it just unmasks a glitch in the implementation of the "Created by me" filtering from PR #36555 .

It might be that the $authorId['by_me'] = $user->id; in line 420 (line number from the file from your PR) inside the if (\in_array('by_me', $authorId)) does not replace the ID in the right array element but adds a new one, and then later the $authorId = ArrayHelper::toInteger($authorId); in line 423 replaces the 'by_me' value by zero at the original array element, so the if (\in_array(0, $authorId)) { in line 425 will be true.

But that's just a theory right now in my head. It would need to debug that to verify that.

avatar richard67
richard67 - comment - 30 Mar 2025

It seems that my theory is right because it helps to replace the

            if (\in_array('by_me', $authorId)) {
                // Replace by_me with the current user id in the array
                $authorId['by_me'] = $user->id;
            }

in lines 418 to 421 by

            $keyByMe = array_search('by_me', $authorId);

            if ($keyByMe !== false) {
                // Replace by_me with the current user id in the array
                $authorId[$keyByMe] = $user->id;
            }

@brianteeman As the original code comes from your PR #36555 : Do you think we should fix that with this PR here?

avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Labels Removed: RTC PR-5.3-dev
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2025
Category Administration com_content Administration com_content Installation Language & Strings Front End Templates (site)
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Labels Added: Language Change
avatar joomla-cms-bot joomla-cms-bot - change - 1 Apr 2025
Category Administration com_content Installation Language & Strings Front End Templates (site) Installation Language & Strings Front End Templates (site)
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2025-04-01 07:46:51
Closed_By AdarshSantoria
avatar AdarshSantoria AdarshSantoria - change - 1 Apr 2025
Status Closed Pending
avatar AdarshSantoria AdarshSantoria - close - 1 Apr 2025
avatar AdarshSantoria AdarshSantoria - close - 1 Apr 2025
avatar AdarshSantoria
AdarshSantoria - comment - 1 Apr 2025

I will create a new fresh pr with all changes and proper testing.

avatar richard67
richard67 - comment - 1 Apr 2025

I will create a new fresh pr with all changes and proper testing.

@AdarshSantoria Why close? The PR was ok, it would only need the change which I have suggested here in addition: #45186 (comment)

avatar AdarshSantoria
AdarshSantoria - comment - 1 Apr 2025

I will create a new fresh pr with all changes and proper testing.

@AdarshSantoria Why close? The PR was ok, it would only need the change which I have suggested here in addition: #45186 (comment)

@richard67 Sorry for the confusion earlier. Initially, I thought there might be more edge cases, so I retested everything carefully to avoid any issues.
No changes in logic. New PR: #45264 — would appreciate a quick review.

Add a Comment

Login with GitHub to post a comment