? Pending

User tests: Successful: Unsuccessful:

avatar alikon
alikon
26 Aug 2021

Summary of Changes

clear the order

Testing Instructions

see #35362

avatar alikon alikon - open - 26 Aug 2021
avatar alikon alikon - change - 26 Aug 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 26 Aug 2021
Category Libraries
avatar richard67
richard67 - comment - 26 Aug 2021

@alikon Same as it was with the other PR at the beginning: Please change the comment in this line here

// Remove the limit and offset part if it's a \JDatabaseQuery object

to // Remove the limit, offset and order parts if it's a \JDatabaseQuery object

I would have made a suggestion on GitHub but that doesn't work if the place of the suggestion in code is too far away from the code changed in a PR.

avatar alikon alikon - change - 26 Aug 2021
Labels Added: ?
avatar bembelimen bembelimen - test_item - 29 Aug 2021 - Tested successfully
avatar bembelimen
bembelimen - comment - 29 Aug 2021

I have tested this item successfully on 41bbe97


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

avatar carcam carcam - test_item - 17 Sep 2021 - Tested unsuccessfully
avatar carcam
carcam - comment - 17 Sep 2021

I have tested this item 🔴 unsuccessfully on 41bbe97

I have applied instructions provided and the "order by" keeps showing:

SELECT l.link_id, l.object,SUM(m.weight) AS ordering
FROM vuu2c_finder_links AS l
INNER JOIN vuu2c_finder_links_terms AS m ON m.link_id = l.link_id
WHERE l.access IN (:preparedArray1,:preparedArray2,:preparedArray3) AND l.state = 1 AND l.published = 1 AND (l.publish_start_date IS NULL OR l.publish_start_date <= '2021-09-17 15:45:00') AND (l.publish_end_date IS NULL OR l.publish_end_date >= '2021-09-17 15:45:00') AND l.language IN ('en-GB', '*') AND m.term_id IN (1836)
GROUP BY l.link_id,l.object
HAVING SUM(CASE WHEN m.term_id IN (1836) THEN 1 ELSE 0 END) > 0
ORDER BY ordering DESC LIMIT 20


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

avatar richard67
richard67 - comment - 17 Sep 2021

I have tested this item 🔴 unsuccessfully on 41bbe97

I have applied instructions provided and the "order by" keeps showing:

SELECT l.link_id, l.object,SUM(m.weight) AS ordering
FROM vuu2c_finder_links AS l
INNER JOIN vuu2c_finder_links_terms AS m ON m.link_id = l.link_id
WHERE l.access IN (:preparedArray1,:preparedArray2,:preparedArray3) AND l.state = 1 AND l.published = 1 AND (l.publish_start_date IS NULL OR l.publish_start_date <= '2021-09-17 15:45:00') AND (l.publish_end_date IS NULL OR l.publish_end_date >= '2021-09-17 15:45:00') AND l.language IN ('en-GB', '*') AND m.term_id IN (1836)
GROUP BY l.link_id,l.object
HAVING SUM(CASE WHEN m.term_id IN (1836) THEN 1 ELSE 0 END) > 0
ORDER BY ordering DESC LIMIT 20
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/35383.

@carcam I think you have mixed up the queries. There are 2 identical ones, one for getting the list items and another second one for getting the count. This PR here modifies that for the count. I.e. before ther PR there are 2 queries with ordering, and with this PR there is only one. You have to check that one which does not have the LIMIT clause. Please revert your wrong test result. Thanks in advance.

avatar richard67
richard67 - comment - 17 Sep 2021

@carcam It might be that you are right but the query which you have pasted in your test result is a query from Joomla 4. It cannot be used here in Joomla 3 in this way with prepared statement.

avatar zero-24
zero-24 - comment - 17 Sep 2021

I can confirm that this code does not seem to get triggered by smart search while i agree that we should clear the order thing in generally too. Will merge this based on the test by @bembelimen and @richard67 's and mine review.

avatar zero-24 zero-24 - change - 17 Sep 2021
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2021-09-17 23:47:15
Closed_By zero-24
avatar zero-24 zero-24 - close - 17 Sep 2021
avatar zero-24 zero-24 - merge - 17 Sep 2021

Add a Comment

Login with GitHub to post a comment