Skip to content

Fix #39698 use the Universal Search Filter syntax for the check deposit account list - #39708

Merged
aspangaro merged 3 commits into
Dolibarr:24.0from
Dolicraft:fix/39698-cheque-select-comptes-usf
Aug 25, 2026
Merged

Fix #39698 use the Universal Search Filter syntax for the check deposit account list#39708
aspangaro merged 3 commits into
Dolibarr:24.0from
Dolicraft:fix/39698-cheque-select-comptes-usf

Conversation

@pixodeo

@pixodeo pixodeo commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Since 24.0, Form::select_comptes() runs its $filtre parameter through forgeSQLFromUniversalSearchCriteria(), but this caller still passed the legacy raw SQL string 'courant <> 2'.

forgeSQLFromUniversalSearchCriteria() does not throw on invalid input, it returns the error text as a string, which is then concatenated into the query, so the request becomes "... AND clos = 0Filter error - Bad syntax of the search string ORDER BY label".

Reproduced by calling the real select_comptes() with both filters:

  • 'courant <> 2': no select rendered, MariaDB reports DB_ERROR_SYNTAX near 'error - Bad syntax of the search string ORDER BY label'
  • '(courant:!=:2)': the select is rendered normally

The generated SQL is equivalent, != is mapped to <> by dolForgeSQLCriteriaCallback(): '(courant:!=:2)' produces " AND ((courant <> 2))" and returns the same rows as the original " AND courant <> 2", so cash registers stay excluded exactly as before.

Affects 24.0 and develop only, select_comptes() did not use USF in 21.0 to 23.0. This was also the last caller passing a non-USF filter, every other one already uses the (courant:=:N) form, and takepos/pay.php passes an empty string which skips the filter entirely.

…ck deposit account list

Since 24.0, Form::select_comptes() passes its $filtre parameter through
forgeSQLFromUniversalSearchCriteria(), but this caller still gave it the
legacy raw SQL string 'courant <> 2'.

forgeSQLFromUniversalSearchCriteria() does not throw on invalid input, it
returns the error text as a string, which is then concatenated into the
query. The result is "... AND clos = 0Filter error - Bad syntax of the
search string ORDER BY label", so the request fails with DB_ERROR_SYNTAX
and the new check deposit page renders no bank account list at all.

The filter now uses the Universal Search Filter syntax. != is mapped to
<> by dolForgeSQLCriteriaCallback(), so the generated SQL keeps excluding
cash registers exactly as before.

This was the last caller of select_comptes() still passing a non-USF
filter, all the others already use the (courant:=:N) form.

Signed-off-by: Dolicraft <contact@dolicraft.com>
@aspangaro
aspangaro merged commit 3332715 into Dolibarr:24.0 Aug 25, 2026
5 checks passed
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.

3 participants