Dolibarr / dolibarr

Dolibarr ERP CRM is a modern software package to manage your company or foundation's activity (contacts, suppliers, invoices, orders, stocks, agenda, accounting, ...). it's an open source Web application (written in PHP) designed for businesses of any sizes, foundations and freelancers.
https://www.dolibarr.org
GNU General Public License v3.0
5.47k stars 2.8k forks source link

Error when deleting thirdparty/contact when using PostgreSQL after upgrade 19 -> 20 #31352

Open jturello-ulink opened 1 month ago

jturello-ulink commented 1 month ago

Bug

Hi,

After upgrading Dolibarr 19 to version 20.0.1, we can't delete contacts anymore. It seems to be related to the SQL query at line 143 in the file societe/contact.php

The clause "DELETE t, et FROM..... LEFT JOIN...." doesn't work with PostgreSQL (maybe MySQL specific?).

Best regards

Dolibarr Version

20.0.1

Environment PHP

7.4

Environment Database

PostgreSQL v13

Steps to reproduce the behavior and expected behavior

Try to delete a thirdparty's contact.

Attached files

No response

ksar-ksar commented 1 month ago

Hello,

Can you give the full SQL command and error message ?

hregis commented 1 month ago

@jturello-ulink can you try with this fix : https://github.com/Dolibarr/dolibarr/pull/31360

jturello-ulink commented 1 month ago

The error message is: ERROR: 42601: syntax error at or near 't' LINE 1: DELETE t, et FROM llx_socpeople AS t LEFT JOIN llx_socpeople... ^ LOCATION: scanner_yyerror, scan.l:1242

I've tried the fix and I can confirm it works! Thanks