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

operator does not exist: integer ~~ unknown LINE 1: SELECT * FROM oc_gestion_configuration WHERE id LIKE $1 #398

Closed
cedricbonhomme opened this issue Jul 5, 2024 · 2 comments

Comments

@cedricbonhomme
Copy link

cedricbonhomme commented Jul 5, 2024

Describe the bug

When generating an invoice (click on the button "Ajouter une facture"), I get in the logs:

An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR: operator does not exist: integer ~~ unknown LINE 1: SELECT * FROM oc_gestion_configuration WHERE id LIKE $1 ^ HINT: No operator matches the given name and argument types. You might need to add explicit type casts.

And of course, nothing is generated.

With more details from Nextcloud:

{"reqId":"<redacted>","level":3,"time":"2024-07-05T21:56:18+00:00","remoteAddr":"<redacted>","user":"<redacted>","app":"index","method":"POST","url":"/index.php/apps/gestion/facture/insert","message":"An exception occurred while executing a query: SQLSTATE[42883]: Undefined function: 7 ERROR:  operator does not exist: integer ~~ unknown\nLINE 1: SELECT * FROM oc_gestion_configuration WHERE id LIKE $1\n  

I found the issue is here:
https://github.com/baimard/gestion/blob/master/lib/Db/Bdd.php#L132

Line 132, I simply replaced LIKE by = (the equality symbol) and it works.

I found strange to use LIKE with an integer. That's why I changed it to =.

@baimard
Copy link
Owner

baimard commented Sep 30, 2024

Tu as toujours le soucis en 2.6.1 ?

@cedricbonhomme
Copy link
Author

De mon côté c'est bon !
Je ferme le ticket !

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

No branches or pull requests

2 participants