Erreur de syntaxe SQL (accès à un dictionnaire / chgt numérotation)

Bonjour,

J’ai l’erreur suivante en accédant au dictionnaire « Note de frais - catégories de déplacement » :

This website or feature is currently temporarly not available or failed after a technical error.

This may be due to a maintenance operation. Current status of operation (2024-06-20T13:11:25Z) are on next line...

Dolibarr a détecté une erreur technique. Vous pouvez lire le fichier log ou définir l'option $dolibarr_main_prod sur '0' dans votre fichier de configuration pour obtenir plus d'informations.This website or feature is currently temporarly not available or failed after a technical error.

This may be due to a maintenance operation. Current status of operation (2024-06-20T13:11:25Z) are on next line...

Dolibarr a détecté une erreur technique. Vous pouvez lire le fichier log ou définir l'option $dolibarr_main_prod sur '0' dans votre fichier de configuration pour obtenir plus d'informations.

Dans dolibarr.log, il y a ceci :

2024-06-20 11:11:25 NOTICE  [IP]    --- Access to GET /admin/dict.php - action=, massaction=

2024-06-20 11:11:25 ERR     [IP]    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 MariaDB server version for the right syntax to use near 'as c WHERE 1 = 1' at line 1

2024-06-20 11:11:25 ERR     [IP]    DoliDBMysqli::query SQL Error query: SELECT COUNT(*) as nbtotalofrecords FROM llx_c_exp_tax_cat c as c WHERE 1 = 1

2024-06-20 11:11:25 ERR     [IP]    DoliDBMysqli::query SQL Error message: DB_ERROR_SYNTAX 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 'as c WHERE 1 = 1' at line 1

2024-06-20 11:11:25 ERR     [IP]    Error url=/admin/dict.php?id=35, query_string=id=35, sql=SELECT COUNT(*) as nbtotalofrecords FROM llx_c_exp_tax_cat c as c WHERE 1 = 1, db_error=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 'as c WHERE 1 = 1' at line 1

2024-06-20 11:11:25 ERR     [IP]    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 MariaDB server version for the right syntax to use near 'as c WHERE 1 = 1 ORDER BY label ASC, c.label ASC LIMIT 1001' at line 1

2024-06-20 11:11:25 ERR     [IP]    DoliDBMysqli::query SQL Error query: SELECT c.rowid, c.label, c.active, c.entity FROM llx_c_exp_tax_cat c as c WHERE 1 = 1 ORDER BY label ASC, c.label ASC LIMIT 1001

2024-06-20 11:11:25 ERR     [IP]    DoliDBMysqli::query SQL Error message: DB_ERROR_SYNTAX 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 'as c WHERE 1 = 1 ORDER BY label ASC, c.label ASC LIMIT 1001' at line 1

2024-06-20 11:11:25 ERR     [IP]    Error url=/admin/dict.php?id=35, query_string=id=35, sql=SELECT c.rowid, c.label, c.active, c.entity FROM llx_c_exp_tax_cat c as c WHERE 1 = 1 ORDER BY label ASC, c.label ASC LIMIT 1001, db_error=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 'as c WHERE 1 = 1 ORDER BY label ASC, c.label ASC LIMIT 1001' at line 1

À noté, je reçois également des erreurs SQL lorque je tente de modifier un masque de numérotation (GRH - Modèles de numérotation (Evaluation)) :

2024-06-20 11:23:42 NOTICE  [IP]    --- Access to POST /admin/hrm.php - action=updateMask, massaction=
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query Exception in query instead of returning an error: Unknown column 'entity' in 'where clause'
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query SQL Error query: SELECT MAX(SUBSTRING(ref, 12, 3)) as val FROM llx_hrm_evaluation WHERE ref LIKE 'EVAL__________' AND ref NOT LIKE '(PROV%)' AND entity IN (1) AND (SUBSTRING(ref, 6, 2) = '24')
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Unknown column 'entity' in 'where clause'
2024-06-20 11:23:42 ERR     [IP]    Error url=/admin/hrm.php, query_string=, sql=SELECT MAX(SUBSTRING(ref, 12, 3)) as val FROM llx_hrm_evaluation WHERE ref LIKE 'EVAL__________' AND ref NOT LIKE '(PROV%)' AND entity IN (1) AND (SUBSTRING(ref, 6, 2) = '24'), db_error=Unknown column 'entity' in 'where clause'
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query Exception in query instead of returning an error: Unknown column 'entity' in 'where clause'
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query SQL Error query: SELECT MAX(SUBSTRING(ref, 12, 3)) as val FROM llx_hrm_evaluation WHERE ref LIKE 'EVAL__________' AND ref NOT LIKE '(PROV%)' AND entity IN (1) AND (SUBSTRING(ref, 6, 2) = '24')
2024-06-20 11:23:42 ERR     [IP]    DoliDBMysqli::query SQL Error message: DB_ERROR_NOSUCHFIELD Unknown column 'entity' in 'where clause'
2024-06-20 11:23:42 ERR     [IP]    Error url=/admin/hrm.php, query_string=, sql=SELECT MAX(SUBSTRING(ref, 12, 3)) as val FROM llx_hrm_evaluation WHERE ref LIKE 'EVAL__________' AND ref NOT LIKE '(PROV%)' AND entity IN (1) AND (SUBSTRING(ref, 6, 2) = '24'), db_error=Unknown column 'entity' in 'where clause'

Comment pourrais-je corriger svp ?

Cordialement,

La première erreur sera corrigé avec la v20.
Modifier « …c_exp_tax_cat c as c… » par « …c_exp_tax_cat as c… » dans le fichier dict.php

Pour la 2eme, essaie de lancer cette requete sur ta base:
ALTER TABLE llx_hrm_evaluation ADD COLUMN entity INTEGER DEFAULT 1 NOT NULL;

Salut @eldy ,
Noté pour le 1. Pour le 2, ta req corrige le problème

Merci pour ta rapidité :slight_smile:

Bonjour, pas corrigé dans la v20 et j’ai justement ce message que je n’avais pas avant, dans la création d’un tache, merci de votre retour , Error in request SELECT rowid as rowid, ref, label FROM dolib_product AND Filter error - Bad syntax of the search string ORDER BY ref, label 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 ‹ AND Filter error - Bad syntax of the search string ORDER BY ref, label › at line 1. Check setup of extra parameters.