?
avatar n9iels
n9iels
7 Dec 2016

Steps to reproduce the issue

  1. Go to Components -> Articles
  2. Click on the ordering filter on the right and select "Sort Tables By:"
    image
  3. The following SQL error appears:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LIMIT 20' at line 11 SQL=SELECT a.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.ordering, a.featured, a.language, a.hits, a.publish_up, a.publish_down,l.title AS language_title, l.image AS language_image,uc.name AS editor,ag.title AS access_level,c.title AS category_title,ua.name AS author_name,COALESCE(NULLIF(ROUND(v.rating_sum / v.rating_count, 0), 0), 0) AS rating, COALESCE(NULLIF(v.rating_count, 0), 0) as rating_count FROM jos_content AS a LEFT JOIN `jos_languages` AS l ON l.lang_code = a.language LEFT JOIN jos_users AS uc ON uc.id=a.checked_out LEFT JOIN jos_viewlevels AS ag ON ag.id = a.access LEFT JOIN jos_categories AS c ON c.id = a.catid LEFT JOIN jos_users AS ua ON ua.id = a.created_by LEFT JOIN jos_content_rating AS v ON a.id = v.content_id WHERE (a.state = 0 OR a.state = 1) ORDER BY LIMIT 20

Expected result

The default value is used for filtering instead of a empty string. (See the view "Featured Articles" for example)

System information (as much as possible)

  • Latest version of Joomla! Staging
  • PHP 5.6.34

Additional comments

This error has something to do with this if statement: https://github.com/joomla/joomla-cms/blob/staging/administrator/components/com_content/models/articles.php#L327

avatar n9iels n9iels - open - 7 Dec 2016
avatar joomla-cms-bot joomla-cms-bot - change - 7 Dec 2016
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 7 Dec 2016
avatar brianteeman brianteeman - change - 7 Dec 2016
Status New Confirmed
avatar brianteeman
brianteeman - comment - 7 Dec 2016

Confirmed on current staging


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

avatar n9iels n9iels - change - 7 Dec 2016
Title
SQL when apply empty filter in com_content
SQL error when apply empty filter in com_content
avatar n9iels n9iels - edited - 7 Dec 2016
avatar brianteeman brianteeman - change - 7 Dec 2016
Status Confirmed Closed
Closed_Date 0000-00-00 00:00:00 2016-12-07 21:45:57
Closed_By brianteeman
avatar brianteeman brianteeman - close - 7 Dec 2016
avatar brianteeman
brianteeman - comment - 7 Dec 2016

Closed as we have a PR for testng - see #13123

Add a Comment

Login with GitHub to post a comment