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

Extrafields and subqueries. File extrafields.class.php, } elseif ($type == 'sellist') { // List of values selected from a table (1 choice) #31401

Open
dieperie opened this issue Oct 15, 2024 · 2 comments
Labels
Bug This is a bug (something does not work as expected)

Comments

@dieperie
Copy link

Bug

According to UCSc, the following : user_rib:number|label:number::(fk_user:=:($SEL$ fk_user_author FROM llx_expensereport WHERE rowid=$ID$)) should be the correct syntax. However, it does not work. The errorr returned is UCS = Filter error - Bad syntax of the search string. The errorr returned from forgeSQLFromUniversalSearchCriteria($InfoFieldList[4], $errstr, 1) is Error in request SELECT number as rowid, number, label FROM llx_user_rib WHERE (fk_user:=:(SELECT fk_user_author FROM llx_expensereport WHERE rowid=339)) ORDER BY number, label You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ':=:(SELECT fk_user_author FROM llx_expensereport WHERE rowid=339)) ORDER BY n...' at line 1. Check setup of extra parameters. The InfoFieldList[4] is (fk_user:=:(SELECT fk_user_author FROM llx_expensereport WHERE rowid=339)).

Dolibarr Version

V20.0.1

Environment PHP

No response

Environment Database

No response

Steps to reproduce the behavior and expected behavior

No response

Attached files

No response

@dieperie dieperie added the Bug This is a bug (something does not work as expected) label Oct 15, 2024
@chbacher
Copy link

I find the same strange issue from an external module that worked with 19.0.3

Error in request SELECT code as rowid, label FROM llx_c_ecommerceng_tax_class WHERE Filter error - Bad syntax of the search string ORDER BY label You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'error - Bad syntax of the search string ORDER BY label' at line 1. Check setup of extra parameters.

Any solutions on how to fix?

@nat-itopie
Copy link
Contributor

Hello
Try not to surround the $SEL$ query with parentheses:
user_rib:number|label:number::(fk_user:=:$SEL$ fk_user_author FROM llx_expensereport WHERE rowid=$ID$)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a bug (something does not work as expected)
Projects
None yet
Development

No branches or pull requests

3 participants