Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[3] backport of #35362 #35383

Merged
merged 2 commits into from
Sep 17, 2021
Merged

[3] backport of #35362 #35383

merged 2 commits into from
Sep 17, 2021

Conversation

alikon
Copy link
Contributor

@alikon alikon commented Aug 26, 2021

Summary of Changes

clear the order

Testing Instructions

see #35362

@richard67
Copy link
Member

@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.

@bembelimen
Copy link
Contributor

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.

@carcam
Copy link

carcam commented Sep 17, 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.

@richard67
Copy link
Member

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.

@richard67
Copy link
Member

@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.

@zero-24
Copy link
Contributor

zero-24 commented Sep 17, 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.

@zero-24 zero-24 added this to the Joomla 3.10.3 milestone Sep 17, 2021
@zero-24 zero-24 merged commit 35ad38b into joomla:3.10-dev Sep 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants