Problem with Plugin Change Thirdparty Errors

Precedents

I purchased the Plugin and after installing the Change Third Party Plugin, I can see the button in the document, but when I click it I get errors on screen as you can see in the Log Files section below.

I have already tried contacting the developer, but they simply responded “Let me try to contact the guy that developed the module as he left the company an year ago.”

The initial support request was on March 2, 2025, and I haven’t received a solution from the developer.

If anyone may have some experience with this kind of error, I would appreciate getting your support.

What I have tried so far?

  1. I tried using a brand-new installation of Version 20.0.4
  2. I also tried with a brand-new installation of Version 19.0.3
  3. I tried to find the MySQL SELECT sentence, to inspect the actual “bad syntax of search string” but I couldn’t grep it on the Plugin’s files successfully. It seems it has a dependence from another module, which I can’t find.
  4. I also tried contacting Dolibarr Support, but they simply sent a reminder to the developers and didn’t respond to my requests for support or refund.

Log files

From Version 20.0.4

Dolibarr ha detectado un error técnico.
Esta información puede ser útil para fines de diagnóstico (puede establecer la opción $dolibarr_main_prod en ‘1’ para ocultar información confidencial):
Fecha: 20250302153806
Dolibarr: 20.0.4 - https://www.dolibarr.org
Inicio de sesión: geppettvs
PHP: 7.1.33
Servidor: LiteSpeed
SO: Linux s3413.mex1.stableserver.net 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC 2023 x86_64
Agente de usuario: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36

URL solicitada: /difmadero/htdocs/fourn/commande/card.php?id=13&action=changethirdparty&page_y=555.5555419921875
Referer: Inicio de sesión @ 20.0.4
Administrar menú: eldy_menu.php

Módulos/Aplicaciones: user, supplier_proposal, fckeditor, projet, categorie, cron, fournisseur, societe, import, changethirdparty, gravatar, product, export
Administrador de tipo de base de datos: mysqli
Último error de solicitud de acceso a la base de datos: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter error - Bad syntax of the search string) ORDER BY nom ASC
Código de respuesta para el último error de solicitud de acceso a la base de datos: DB_ERROR_SYNTAX
Información para el último error de solicitud de acceso a la base de datos: 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 nom ASC’ at line 1


I also tried with brand-new installation of version 19.0.3, and I yet receive the same errors. Please see the error logs.


From Version 19.0.3

Dolibarr ha detectado un error técnico.
Esta información puede ser útil para fines de diagnóstico (puede establecer la opción $dolibarr_main_prod en ‘1’ para ocultar información confidencial):
Fecha: 20250302160440
Dolibarr: 19.0.3 - https://www.dolibarr.org
Nivel de características: 0
PHP: 7.1.33
Server: LiteSpeed
OS: Linux s3413.mex1.stableserver.net 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC 2023 x86_64
Agente de usuario: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36

URL solicitada: /difmadero/htdocs/supplier_proposal/card.php?id=24&action=changethirdparty&page_y=195.55555725097656
Referer: Inicio de sesión @ 20.0.4
Administrar menú: eldy_menu.php

Módulos/Aplicaciones: user, supplier_proposal, fckeditor, projet, categorie, cron, fournisseur, societe, import, changethirdparty, gravatar, product, export
Administrador de tipo de base de datos: mysqli
Último error de solicitud de acceso a la base de datos: SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter syntax error - Bad syntax of the search string) ORDER BY nom ASC
Código de respuesta para el último error de solicitud de acceso a la base de datos: DB_ERROR_SYNTAX
Información para el último error de solicitud de acceso a la base de datos: 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 ‘syntax error - Bad syntax of the search string) ORDER BY nom ASC’ at line 1


Kindly let me know how to fix.

If you need further information, please let me know to update this question.

Which database version do you use?

what other modules do you have installed?

Sorry for the delay, I needed to verify with my hosting service provider.

Database: MariaDB 10.6.21
PHP: 8.3.19

Kindly let me know if you need more information, and thanks for your support.

I’d like to know what other modules, though I don’t think there should be a conflict - but there might

Only the core modules. I didn’t install any other third party modules so far. This is the one I am interested in for now.

Thanks

Okay. Please read this first, then try it, delete the files in /tmp and do it again for real. The goal is to get JUST relevant log snippets

  1. find dolibarr.log
  2. find the webserver log
  3. run tail dolibarr.log - just to see if it works
  4. run tail webserver log - just to see it works
  5. open multiple browser windows or multiple browser tabs
  6. find the debug logging function and enable it - leave this page open
  7. run tail -f dolibarr.log | tee /tmp/new_short_doli_log_file.txt
  8. run tail -f webserver log | tee /tmp/new_short_webserver_log_file.txt
  9. do what ever causes this error while keeping the step 7 and 8 open
  10. ctrl+c on step 7 and 8 so you stop adding to the short log files
  11. in window nr. 6. reduce the log level
  12. check the short log files for explanations
  13. if needed clean up the log files from secret information and share it here

what is secret informations? Hostnames ip addresses, usernames, hash values, keys, …

Thanks for your help and patience.

I tried to find the .log files with no success. Is it there a specific folder where I should look for?

sorry, I should have told you that it is usually stored in the documents folder. Maybe it requires the debug logging module to be enabled to appear?

Thanks for the help. I enabled the logging module and I ran the tail commands to look for the error.

Attached you will find the file “part-dolibarr.log” in which I see the next error codes:

part-dolibarr.log (55.9 KB)

2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 HookManager::initHooks Loading hooks: context=fileslib-path=/changethirdparty/class/actions_changethirdparty.class.php-priority=50
2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 sql=SELECT COUNT(rowid) as nb FROM llx_links WHERE objecttype = 'facture' AND objectid = 976 AND entity = 1
2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 sql=SELECT COUNT(id) as nb FROM llx_actioncomm WHERE fk_element = 976 AND elementtype = 'invoice'
2025-04-04 14:28:23 WARNING 99.999.999.999   702822     33 forgeSQLFromUniversalSearchCriteria Filter error - Bad syntax of the search string: (s.client=1 OR s.client=2 OR s.client=3)
2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 Form::select_thirdparty_list
2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 sql=SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter error - Bad syntax of the search string) ORDER BY nom ASC
2025-04-04 14:28:23 ERR     99.999.999.999   702822     33 DoliDBMysqli::query Exception in query instead of returning an error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'error - Bad syntax of the search string) ORDER BY nom ASC' at line 1
2025-04-04 14:28:23 ERR     99.999.999.999   702822     33 DoliDBMysqli::query SQL Error message: DB_ERROR_SYNTAX You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'error - Bad syntax of the search string) ORDER BY nom ASC' at line 1 From /home/robot/SUPERGUPPY/www/erp/htdocs/core/class/html.form.class.php:1610.
2025-04-04 14:28:23 ERR     99.999.999.999   702822     33 Error url=/erp/htdocs/compta/facture/card.php?id=976&action=changethir[Processing: part-dolibarr.log…]()
dparty&page_y=720.8333129882812, query_string=id=976&action=changethirdparty&page_y=720.8333129882812, sql=SELECT s.rowid, s.nom as name, s.name_alias, s.tva_intra, s.client, s.fournisseur, s.code_client, s.code_fournisseur FROM llx_societe as s WHERE s.entity IN (1) AND (Filter error - Bad syntax of the search string) ORDER BY nom ASC, db_error=You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'error - Bad syntax of the search string) ORDER BY nom ASC' at line 1
2025-04-04 14:28:23 DEBUG   99.999.999.999   702822     33 HookManager::initHooks Loading hooks: context=thirdpartydao-path=/changethirdparty/class/actions_changethirdparty.class.php-priority=50

This part seems to be the guilty:

(s.client=1 OR s.client=2 OR s.client=3)

Nevertheless, I don’t know where to find that code snippet to try and modify it. In addition, I don’t know how to transform that code into something which will work.

Edit

I found the file containing the guilty code, this is the snippet:

        //Form confirm dialog to select new thirdparty for commercial proposal(propale)
        if (in_array('propalcard', explode(':', $parameters['context']))) {
            if ($action == 'changethirdparty') {
                $formquestion = array(
                    array('type' => 'other', 'name' => 'socid', 'label' => $langs->trans("SelectThirdParty"), 'value' => $form->select_company($object->socid, 'socid', '(s.client=1 OR s.client=2 OR s.client=3)', 1))
                );
                print $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans("ToChange"), '', 'confirm_changethirdparty', $formquestion, '', 1, 300, 590);
            }
        }

This code appears at least 3 times in the same file, seems to have different purposes. Does it give us a clue?