User tests: Successful: Unsuccessful:
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:
0
(representing "None")created_by NOT IN (SELECT id FROM #__users)
author_id = [0, 42]
, to include both deleted users and existing onescreated_by = 0
was used incorrectly.created_by NOT IN (SELECT id FROM #__users)
for deleted users.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
Status | New | ⇒ | Pending |
Category | ⇒ | Administration com_content |
Title |
|
Labels |
Added:
PR-5.2-dev
|
I have tested this item ✅ successfully on 66cd254
Thank you for your feedbacks, @fgsw @brianteeman.
great work!!
I have tested this item ✅ successfully on 66cd254
No deleted user
One deleted user
One deleted user
Three deleted user
Status | Pending | ⇒ | Ready to Commit |
Build | 5.2-dev | ⇒ | 5.3-dev |
RTC
Good work with this PR, really like it, just found a minor thing you probably could fix.
Labels |
Added:
RTC
PR-5.3-dev
Removed: PR-5.2-dev |
Title |
|
As agreed today in the maintainers meeting, I've rebased this PR to 5.4-dev.
Labels |
Added:
PR-5.4-dev
|
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.
Status | Ready to Commit | ⇒ | Pending |
Back to pending due to unsuccessful human test.
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.
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.
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?
Labels |
Removed:
RTC
PR-5.3-dev
|
Category | Administration com_content | ⇒ | Administration com_content Installation Language & Strings Front End Templates (site) |
Labels |
Added:
Language Change
|
Category | Administration com_content Installation Language & Strings Front End Templates (site) | ⇒ | Installation Language & Strings Front End Templates (site) |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2025-04-01 07:46:51 |
Closed_By | ⇒ | AdarshSantoria |
Status | Closed | ⇒ | Pending |
I will create a new fresh pr with all changes and proper testing.
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)
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.
@AdarshSantoria Please delete "Fix #45181 - " from the title.
The title say [5.3], but the label is PR-5.2-dev.