From 31aa3ec376c4befb9f1355d837994f1ccf00258f Mon Sep 17 00:00:00 2001 From: Cristian Torres Date: Wed, 20 Feb 2019 11:45:07 -0600 Subject: [PATCH] [FIX] ORDER BY before custom filters for where When filtering data "and cac.libelle" would be appended after ORDER BY --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index d170675aa81..fc2c173d90c 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -418,6 +418,6 @@ class modAgenda extends DolibarrModules $this->export_sql_end[$r] .=' WHERE ac.entity IN ('.getEntity('agenda').')'; if (empty($user->rights->societe->client->voir)) $this->export_sql_end[$r] .=' AND (sc.fk_user = '.(empty($user)?0:$user->id).' OR ac.fk_soc IS NULL)'; if (empty($user->rights->agenda->allactions->read)) $this->export_sql_end[$r] .=' AND acr.fk_element = '.(empty($user)?0:$user->id); - $this->export_sql_end[$r] .=' ORDER BY ac.datep'; + $this->export_sql_order[$r] .=' ORDER BY ac.datep'; } }