No Code Attached Yet bug
avatar brianteeman
brianteeman
21 Mar 2025

Steps to reproduce the issue

Create two users
Create articles with each user
Delete one of the users
use the author filter to filter for "none"

Image

Expected result

the article by the deleted user is displayed

Actual result

no articles are displayed

This is because the filter is setting an id of 0 when you filter by author nonw so the query is looking for a user with a created_by id of 0 BUT When a user is deleted from the users table the created_by in the content table is untouched so the condition in the query is never passed.

SELECT a.id,a.asset_id,a.title,a.alias,a.checked_out,a.checked_out_time,a.catid,a.state,a.access,a.created,a.created_by,a.created_by_alias,a.modified,a.ordering,a.featured,a.language,a.hits,a.publish_up,a.publish_down,a.introtext,a.fulltext,a.note,a.images,a.metakey,a.metadesc,a.metadata,a.version,fp.featured_up,fp.featured_down,l.titleASlanguage_title,l.imageASlanguage_image,uc.nameASeditor,ag.titleASaccess_level,c.titleAScategory_title,c.created_user_idAScategory_uid,c.levelAScategory_level,c.publishedAScategory_published,parent.titleASparent_category_title,parent.idASparent_category_id,parent.created_user_idASparent_category_uid,parent.levelASparent_category_level,ua.nameASauthor_name,wa.stage_idASstage_id,ws.titleASstage_title,ws.workflow_idASworkflow_id,w.titleASworkflow_titleFROMjos_contentASaLEFT JOINjos_languagesASlONl.lang_code=a.languageLEFT JOINjos_content_frontpageASfpONfp.content_id=a.idLEFT JOINjos_usersASucONuc.id=a.checked_outLEFT JOINjos_viewlevelsASagONag.id=a.accessLEFT JOINjos_categoriesAScONc.id=a.catidLEFT JOINjos_categoriesASparentONparent.id=c.parent_idLEFT JOINjos_usersASuaONua.id=a.created_byINNER JOINjos_workflow_associationsASwaONwa.item_id=a.idINNER JOINjos_workflow_stagesASwsONws.id=wa.stage_idINNER JOINjos_workflowsASwONw.id=ws.workflow_idWHEREwa.extension= 'com_content.article' ANDa.stateIN (1,0) ANDa.created_by IN (0) ORDER BY a.id DESC LIMIT 20

I am unsure of the correct query for author = none but it should probably be checking that created_by exists in #__users and not for created_by = 0

System information (as much as possible)

Additional comments

this is just an example with com_content - the same problem will exist in all uses of the authors field for filters

avatar brianteeman brianteeman - open - 21 Mar 2025
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 21 Mar 2025
avatar brianteeman brianteeman - change - 21 Mar 2025
The description was changed
avatar brianteeman brianteeman - edited - 21 Mar 2025
avatar brianteeman brianteeman - change - 21 Mar 2025
The description was changed
avatar brianteeman brianteeman - edited - 21 Mar 2025
avatar chmst chmst - change - 21 Mar 2025
Labels Added: bug
avatar chmst chmst - labeled - 21 Mar 2025
avatar brianteeman brianteeman - change - 22 Mar 2025
Status New Closed
Closed_Date 0000-00-00 00:00:00 2025-03-22 08:28:28
Closed_By brianteeman
avatar brianteeman brianteeman - close - 22 Mar 2025
avatar brianteeman
brianteeman - comment - 22 Mar 2025

closed as we have a pr for testing

Add a Comment

Login with GitHub to post a comment