Dolibarr has detected a technical error

Hello good afternoon!

When creating a new module and accessing the list of this new module it presents the following error to me:

Dolibarr has detected a technical error.
You use an experimental or develop level of features, so please do NOT report any bugs, except if problem is confirmed moving MAIN_FEATURES_LEVEL back to 0.
This information can be useful for diagnosing problems (you can set $ dolibarr_main_prod to ‘1’ if you want to remove these notifications):
Date: 20190115164029
Dolibarr: 8.0.3
Function Level: 2
PHP: 5.6.39
Server: Apache
OS: Linux d2wvm305.dot2web.com 3.10.0-862.3.2.el7.x86_64 # 1 SMP Mon May 21 23:36:36 UTC 2018 x86_64
UserAgent: Mozilla / 5.0 (Windows NT 10.0; Win64; x64; rv: 64.0) Gecko / 20100101 Firefox / 64.0

Requested URL: /htdocs/custom/supervisando/supervisando_list.php?idmenu=362&mainmenu=supervisando&leftmenu=
Referer: https://crm.institutocriap.com/htdocs/custom/supervisando/supervisandoindex.php?idmenu=361&mainmenu=supervisando&leftmenu=
Menu management: eldy_menu.php

Database type manager: mysqli
The last incorrect request for database access: SELECT t.name, t.rowid, t.morada, t.zipcode, t.locality, t.telemovel, t.email, t.data, t.nationality, t. t.fk_soc, t.note_public, t.date_creation, t.tms, t.fk_user_creat, t.fk_user_modif, t.import_key FROM llx_supervising_supervising t WHERE 1 = 1 ORDER BY t. ASC LIMIT 21
Return the code for the last incorrect request for database access: DB_ERROR_SYNTAX
Information about the last incorrect request for database access: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use ‘ASC LIMIT 21’ at line 1

Remember that I used the module editor of version 8.0.3 of dolibarr.

Does anyone know what this error is about?

Regards,

Leonardo

Hi,

This error comes from extranal module : supervisando
You should contact the developper.

1 Like

Hi Ksar,

I developed this module through the module developer existing in the dolibarr itself.

The impression I have is that there is no problem in the Left Join script done in the file supervisando_list.php

Remember that this file is generated automatically by the dolibarr module developer.

Here is the snippet of code that shows the failure:

// Build and execute select
// ------------------------------------------------

$ sql = ‘SELECT’;
foreach ($ object-> fields as $ key => $ val)
{
$ sql. = ‘t.’. $ key. ‘,’;
}
// Add fields from extrafields
if (! empty ($ extrafields-> attributes [$ object-> table_element] [‘label’]))
($ object-> table_element] [‘type’] [$ object-> table_element] [‘type’] [$ object-> table_element] [‘label’] $ string = $ extrafields-> $ key]! = ‘separate’? “and” $ key. ‘as options _’. $ key. ‘,’: ‘’);
// Add fields from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListSelect’, $ parameters, $ object); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;
$ sql = preg_replace (’/, $ /’, ‘’, $ sql);
$ sql. = “FROM” .MAIN_DB_PREFIX. $ object-> table_element. “as t”;
if (is_array ($ extrafields-> attributes [$ object-> table_element] [‘label’]) && count ($ extrafields-> attributes [$ object-> table_element] [‘label’])) $ sql. = "LEFT JOIN “.MAIN_DB_PREFIX. $ Object-> table_element.” _ Extrafields as ef on (t.rowid = ef.fk_object) ";
if ($ object-> ismultientitymanaged == 1) $ sql. = “WHERE t.entity IN (” .getEntity ($ object-> element). “)”;
else $ sql. = “WHERE 1 = 1”;
foreach ($ search as $ key => $ val)
{
if ($ key == ‘status’ && $ search [$ key] == -1) continue;
$ mode_search = (($ object-> isInt ($ object-> fields [$ key]) || $ object-> isFloat ($ object-> fields [$ key])? 1: 0);
if ($ search [$ key]! = ‘’) $ sql = natural_search ($ key, $ search [$ key], (($ key == ‘status’)? 2: $ mode_search));
}
if ($ search_all) $ sql. = natural_search (array_keys ($ fieldstosearchall), $ search_all);
// Add where from extra fields
include DOL_DOCUMENT_ROOT. ‘/ core / tpl / extrafields_list_search_sql.tpl.php’;
// Add where from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListWhere’, $ parameters, $ object); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;

/ * If a group by is required
$ sql. = “GROUP BY”
foreach ($ object-> fields as $ key => $ val)
{
$ sql. = ‘t.’. $ key. ‘,’;
}
// Add fields from extrafields
if (! empty ($ extrafields-> attributes [$ object-> table_element] [‘label’])) {
($ object-> table_element] [‘type’] [$ object-> table_element] [‘type’] [$ object-> table_element] [‘label’] $ string = $ extrafields-> $ key]! = ‘separate’? “ef.”. $ key. ‘,’: ‘’);
// Add where from hooks
$ parameters = array ();
$ reshook = $ hookmanager-> executeHooks (‘printFieldListGroupBy’, $ parameters); // Note that $ action and $ object may have been modified by hook
$ sql. = $ hookmanager-> resPrint;
$ sql = preg_replace (’/, $ /’, ‘’, $ sql);
* /

$ sql. = $ db-> order ($ sortfield, $ sortorder);

// Count total nb of records
$ nbtotalofrecords = ‘’;
if (empty ($ conf-> global-> MAIN_DISABLE_FULL_SCANLIST))
{
$ resql = $ db-> query ($ sql);
$ nbtotalofrecords = $ db-> num_rows ($ resql);
if (($ page * $ limit)> $ nbtotalofrecords) // if total of record found is smaller than page * limit, goto and load page 0
{
$ page = 0;
$ offset = 0;
}
}
// if total of record found is smaller than limit, no need to paging and to restart another select with limits set.
if (is_numeric ($ nbtotalofrecords) && $ limit> $ nbtotalofrecords)
{
$ num = $ nbtotalofrecords;
}
else
{
$ sql. = $ db-> plimit ($ limit + 1, $ offset);

$ resql = $ db-> query ($ sql);
if (! $ resql)
{
dol_print_error ($ db);
exit;
}

$ num = $ db-> num_rows ($ resql);
}

// Direct jump if only one record found
if ($ num == 1 &&! empty ($ conf-> global-> MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $ search_all)
{
$ obj = $ db-> fetch_object ($ resql);
$ id = $ obj-> rowid;
header (“Location:” .DOL_URL_ROOT. ‘/ monitoring / monitoring_card.php? id =’. $ id);
exit;
}

For if I disable this snippet of code, the list loads, it is quite true that without the Label template, but it loads.

Another curiosity, when I fill out the form of this module it does not present the completed plug, a gray screen appears in the background, with nothing.

When I do query in the table monitoring the information is not there.

What should I do?

To release some permission in the bank, to change some type of parameter?

Is this a bug in the developer of dolibarr modules?

Regards,

I don’t see this was resolved. For my part, using 13.0.1 I found the error in core/tpl/extrafields_list_search_sql.tpl.php with postgresql on select list. On line 43, the script is surrounding the search value by double quotes. That would be wrong in standard SQL and particularly in postgresql. Change the code to use single quotes:

" = ‘".$db->escape($crit)."’)"

and the problem was solved