From 03f9f0bada4d7c88e6b7b050518c5bb76b032b59 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur <eldy@destailleur.fr> Date: Sat, 3 May 2014 20:21:35 +0200 Subject: [PATCH] Fix: Pb of records not correctly cleaned when module marge is uninstalled (conflict between 'margin' and 'margins'). --- ChangeLog | 2 ++ htdocs/core/modules/modMargin.class.php | 3 +-- htdocs/install/mysql/migration/repair.sql | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04a5b8a7d1b..cb2b906ea27 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ Fix: [ bug #1352 ] Removing a shipping does not remove the delivery. Fix: Option MAIN_INVERT_SENDER_RECIPIENT broken with typhon template. Fix: Can disable features with PHPEXCEL (no DLSF compatible). Fix: Can disable features with CKEDITOR. +Fix: Pb of records not correctly cleaned when module marge is + uninstalled (conflict between 'margin' and 'margins'). ***** ChangeLog for 3.5.2 compared to 3.5.1 ***** Fix: Can't add user for a task. diff --git a/htdocs/core/modules/modMargin.class.php b/htdocs/core/modules/modMargin.class.php index f71fd6ed53f..d0cfa8d4edd 100644 --- a/htdocs/core/modules/modMargin.class.php +++ b/htdocs/core/modules/modMargin.class.php @@ -42,7 +42,7 @@ class modMargin extends DolibarrModules // Use here a free id (See in Home -> System information -> Dolibarr for list of used modules id). $this->numero = 59000; // Key text used to identify module (for permissions, menus, etc...) - $this->rights_class = 'margin'; + $this->rights_class = 'margins'; // Family can be 'crm','financial','hr','projects','products','ecm','technic','other' // It is used to group modules in module setup page @@ -114,7 +114,6 @@ class modMargin extends DolibarrModules // Permissions $this->rights = array(); - $this->rights_class = 'margins'; $r=0; $r++; diff --git a/htdocs/install/mysql/migration/repair.sql b/htdocs/install/mysql/migration/repair.sql index 7fc424caa73..a058588ddef 100644 --- a/htdocs/install/mysql/migration/repair.sql +++ b/htdocs/install/mysql/migration/repair.sql @@ -3,7 +3,6 @@ -- when current version is 2.6.0 or higher. -- - -- Requests to clean corrupted database -- delete foreign key that should never exists @@ -101,6 +100,10 @@ UPDATE llx_product p SET p.stock= (SELECT SUM(ps.reel) FROM llx_product_stock ps -- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid; -- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note); +-- We delete old entries into menu for module margin (pb with margin and margins) +-- VMYSQL DELETE from llx_menu where module = 'margin' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); +-- VMYSQL DELETE from llx_menu where module = 'margins' and url = '/margin/index.php' and not exists (select * from llx_const where name = 'MAIN_MODULE_MARGIN' or name = 'MAIN_MODULE_MARGINS'); + -- Requests to clean old tables or fields -- GitLab