From 3f839c2a961f204fddfc74ab4cbe4f25758596f9 Mon Sep 17 00:00:00 2001 From: Marc de Lima Lucio <68746600+marc-dll@users.noreply.github.com> Date: Mon, 26 Oct 2020 16:11:21 +0100 Subject: [PATCH 1/3] FIX: product customer prices: missing triggers in CRUD class --- .../class/productcustomerprice.class.php | 35 +++++++------------ 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/htdocs/product/class/productcustomerprice.class.php b/htdocs/product/class/productcustomerprice.class.php index 8405120ddef..7e77154fb32 100644 --- a/htdocs/product/class/productcustomerprice.class.php +++ b/htdocs/product/class/productcustomerprice.class.php @@ -219,15 +219,11 @@ class Productcustomerprice extends CommonObject $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX . "product_customer_price"); if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_CREATE', $user); - // // Call triggers - // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - // $interface=new Interfaces($this->db); - // $result=$interface->run_triggers('MYOBJECT_CREATE',$this,$user,$langs,$conf); - // if ($result < 0) { $error++; $this->errors=$interface->errors; } - // // End call triggers + if ($result < 0) { + $error++; + } } } @@ -714,12 +710,11 @@ class Productcustomerprice extends CommonObject if (! $error) { if (! $notrigger) { - // Call triggers - include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - $interface=new Interfaces($this->db); - $result=$interface->run_triggers('PRODUCT_CUSTOMER_PRICE_UPDATE', $this, $user, $langs, $conf); - if ($result < 0) { $error++; $this->errors=$interface->errors; } - // End call triggers + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_UPDATE', $user); + + if ($result < 0) { + $error++; + } } } @@ -854,15 +849,11 @@ class Productcustomerprice extends CommonObject if (! $error) { if (! $notrigger) { - // Uncomment this and change MYOBJECT to your own tag if you - // want this action calls a trigger. + $result = $this->call_trigger('PRODUCT_CUSTOMER_PRICE_DELETE', $user); - // // Call triggers - // include_once DOL_DOCUMENT_ROOT . '/core/class/interfaces.class.php'; - // $interface=new Interfaces($this->db); - // $result=$interface->run_triggers('MYOBJECT_DELETE',$this,$user,$langs,$conf); - // if ($result < 0) { $error++; $this->errors=$interface->errors; } - // // End call triggers + if ($result < 0) { + $error++; + } } } From 3ee618d736448f28d5a6e2d478176b7cdac3a858 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2020 18:31:12 +0100 Subject: [PATCH 2/3] FIX Clean orphan records in llx_ecm_files into repair script. --- htdocs/install/mysql/migration/repair.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index aa5ab65d3ff..021cb61c1fc 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -185,6 +185,7 @@ delete from llx_categorie_project where fk_categorie not in (select rowid from l -- Fix: delete orphelins in ecm_files delete from llx_ecm_files where src_object_type = 'expensereport' and src_object_id NOT IN (select rowid from llx_expensereport); +delete from llx_ecm_files where (src_object_type = 'contrat' OR src_object_type = 'contract') and src_object_id NOT IN (select rowid from llx_contrat); -- Fix: delete orphelin deliveries. Note: deliveries are linked to shipment by llx_element_element only. No other links. delete from llx_livraisondet where fk_livraison not in (select fk_target from llx_element_element where targettype = 'delivery') AND fk_livraison not in (select fk_source from llx_element_element where sourcetype = 'delivery'); From c58d3d0cf77327b63d7a88586bbd06c3827ea2cc Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 26 Oct 2020 19:02:26 +0100 Subject: [PATCH 3/3] FIX #15163 --- htdocs/main.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index 63b8eaa5561..88d13320271 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -1591,6 +1591,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if (! empty($conf->global->MAIN_FEATURES_LEVEL)) $appli.="
".$langs->trans("LevelOfFeature").': '.$conf->global->MAIN_FEATURES_LEVEL; $logouttext=''; + $logouthtmltext = ''; if (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { //$logouthtmltext=$appli.'
';