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

fix PostgreSQL error #43759

Open
wants to merge 1 commit into
base: 4.4-dev
Choose a base branch
from
Open

fix PostgreSQL error #43759

wants to merge 1 commit into from

Conversation

wussup
Copy link

@wussup wussup commented Jul 8, 2024

for SELECT DISTINCT, ORDER BY expressions must appear in select list

Summary of Changes

remove order by for distinct select

Testing Instructions

access com_finder component with query strings: ?task=suggestions.suggest&format=json&tmpl=component&q=eW

Actual result BEFORE applying this Pull Request

error:
42P10, 7, ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
LINE 6: ORDER BY t.links DESC,t.weight DESC LIMIT 10
^

Warning: foreach() argument must be of type array|object, bool given in \components\com_finder\src\Model\SuggestionsModel.php on line 54

{ "suggestions": [] }

Expected result AFTER applying this Pull Request

{ "suggestions": [] }

Link to documentations

  • No documentation changes for docs.joomla.org needed
  • No documentation changes for manual.joomla.org needed

for SELECT DISTINCT, ORDER BY expressions must appear in select list
@Hackwar
Copy link
Member

Hackwar commented Jul 21, 2024

Unfortunately this breaks the ordering of the suggestions. This PR unfortunately can't be merged like this.

@richard67
Copy link
Member

Unfortunately this breaks the ordering of the suggestions. This PR unfortunately can't be merged like this.

Then the query needs to be changed so it returns also the columns which are used in the order by, possibly as subquery with the surrounding query returning only the term.

@Quy Quy added the Updates Requested Indicates that this pull request needs an update from the author and should not be tested. label Aug 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug PR-4.4-dev Updates Requested Indicates that this pull request needs an update from the author and should not be tested.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants