Fix #39698 use the Universal Search Filter syntax for the check deposit account list - #39708
Merged
aspangaro merged 3 commits intoAug 25, 2026
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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.