?
avatar toperf
toperf
12 Aug 2014

Steps to reproduce the issue

In JModelList I was using a query with a condition [where] that was put outside the limit making the query invalid:
SELECT t.id AS id, t.type AS type,t.code AS code,t.prodAlpha AS prodAlpha, t.retailerCode AS retailerCode,t.startDate AS startDate, t.endDate AS endDate,t.imageType AS imageType FROM [ApplicationImage] AS t WHERE t.type = 'BANNER'

Expected result

SELECT * FROM ( SELECT t.id AS id, t.type AS type,t.code AS code,t.prodAlpha AS prodAlpha, t.retailerCode AS retailerCode,t.startDate AS startDate, t.endDate AS endDate,t.imageType AS imageType , ROW_NUMBER() OVER (ORDER BY t.id desc) AS RowNumber FROM [ApplicationImage] AS t WHERE t.type = 'BANNER') _myResults WHERE RowNumber BETWEEN 1 AND 20

Actual result

SELECT * FROM ( SELECT t.id AS id, t.type AS type,t.code AS code,t.prodAlpha AS prodAlpha, t.retailerCode AS retailerCode,t.startDate AS startDate, t.endDate AS endDate,t.imageType AS imageType , ROW_NUMBER() OVER (ORDER BY t.id desc) AS RowNumber FROM [ApplicationImage] AS t ) _myResults WHERE RowNumber BETWEEN 1 AND 20 WHERE t.type = 'BANNER'

System information (as much as possible)

Joomla! 3.3.3

Additional comments

Moving lines 70-78 on "\libraries\joomla\database\query\sqlsrv.php" to before the break did the trick for me

avatar perfeito perfeito - open - 12 Aug 2014
avatar mbabker
mbabker - comment - 12 Aug 2014

Would you be able to prepare a pull request with your change? http://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests will help you greatly if you've never done one before.

avatar sovainfo
sovainfo - comment - 12 Aug 2014

Already fixed by #4019!

avatar zero-24 zero-24 - close - 13 Aug 2014
avatar brianteeman
brianteeman - comment - 13 Aug 2014

Closing

avatar brianteeman brianteeman - change - 13 Aug 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-08-13 09:04:50
avatar brianteeman brianteeman - close - 13 Aug 2014
avatar zero-24 zero-24 - change - 7 Jul 2015
Labels Added: ?

Add a Comment

Login with GitHub to post a comment