forked from Wavyzz/dolibarr
Fix compatibility with hooks tha add , at begin of sql string
This commit is contained in:
@@ -221,8 +221,8 @@ if (! empty($extrafields->attributes[$object->table_element]['label']))
|
||||
// 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.=preg_replace('/^,/', '', $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).")";
|
||||
|
||||
Reference in New Issue
Block a user