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

ERROR: syntax error at or near "WHERE" LINE 5: WHERE "t"."id" = $1 AND "t"."workflow_id" = "w"."id" AND "t"... ^ #42031

Closed
kochinc opened this issue Oct 3, 2023 · 2 comments

Comments

@kochinc
Copy link
Contributor

kochinc commented Oct 3, 2023

Steps to reproduce the issue

  1. Log in Administrator.
  2. Enable Workflow.
  3. From left menu, select Content -> Articles.
  4. From the Stage column, click on one of the item to change transition.

Expected result

The selected item changes to the new transition.

Actual result

An error has occurred.
42601 42601, 7, ERROR: syntax error at or near "WHERE" LINE 5: WHERE "t"."id" = $1 AND "t"."workflow_id" = "w"."id" AND "t"... ^

System information (as much as possible)

php: Linux Web 5.15.116-1-pve #1 SMP PVE 5.15.116-1 (2023-08-29T13:46Z) x86_64
dbserver: postgresql
dbversion: 15.3
dbcollation: en_US.utf8
dbconnectioncollation: en_US.utf8
dbconnectionencryption: 
dbconnencryptsupported: false
phpversion: 8.2.11
server: nginx/1.22.1
sapi_name: fpm-fcgi
version: Joomla! 4.3.4 Stable [ Bora ] 22-August-2023 16:00 GMT
useragent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36

Additional comments

This error was observed on a Joomla 4.3.4 installation with PostgreSQL. The error didn't show up on a Joomla 4.3.4 installation with MySQL.

Error messages on PostgreSQL log:

2023-10-03 18:00:32.291 UTC [29890] ERROR:  syntax error at or near "WHERE" at character 234
2023-10-03 18:00:32.291 UTC [29890] STATEMENT:  SELECT "t"."id","t"."to_stage_id","t"."from_stage_id","t"."options","t"."workflow_id"
        FROM "j4ml_workflow_transitions" AS "t"
        INNER JOIN "j4ml_workflows" AS "w"
        LEFT JOIN "j4ml_workflow_stages" AS "s" ON "s"."id" = "t"."to_stage_id"
        WHERE "t"."id" = $1 AND "t"."workflow_id" = "w"."id" AND "t"."published" = 1 AND "w"."extension" = $2
@alikon
Copy link
Contributor

alikon commented Oct 3, 2023

confirmed

@alikon alikon added the bug label Oct 3, 2023
kochinc added a commit to kochinc/joomla-cms that referenced this issue Oct 3, 2023
Proposed fix for the reported error at joomla#42031:
An error has occurred.
42601 42601, 7, ERROR: syntax error at or near "WHERE" LINE 5: WHERE "t"."id" = $1 AND "t"."workflow_id" = "w"."id" AND "t"... ^
@alikon alikon mentioned this issue Oct 3, 2023
4 tasks
kochinc added a commit to kochinc/joomla-cms that referenced this issue Oct 3, 2023
@richard67
Copy link
Member

Closing as having a pull request. See #42036 . Thanks @kochinc .

MacJoom pushed a commit that referenced this issue Oct 30, 2023
* Update UsersModel.php for 'GROUP BY' fix

* Update administrator/components/com_users/src/Model/UsersModel.php

Conform to coding style

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>

* Update Workflow.php for issue #42031

Proposed fix for the reported error at #42031:
An error has occurred.
42601 42601, 7, ERROR: syntax error at or near "WHERE" LINE 5: WHERE "t"."id" = $1 AND "t"."workflow_id" = "w"."id" AND "t"... ^

* Revised update Workflow.php for #42031

Corrected join() call.

* Update Workflow.php for code style

Remove a space which caused phpcs complained.

---------

Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Quy <quy@nomonkeybiz.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants