diff --git a/htdocs/install/repair.php b/htdocs/install/repair.php
index bab7b5e5da4..895d36d72f1 100644
--- a/htdocs/install/repair.php
+++ b/htdocs/install/repair.php
@@ -62,12 +62,10 @@ if (! is_object($conf)) dolibarr_install_syslog("repair: conf file not initializ
/*
* View
-*/
+ */
pHeader('',"upgrade2",GETPOST('action','aZ09'));
-$actiondone=0;
-
// Action to launch the repair script
$actiondone=1;
@@ -79,6 +77,7 @@ print 'Option clean_orphelin_dir (0 or \'test\' or \'confirmed\') is '.(GETPOST(
print 'Option clean_product_stock_batch (0 or \'test\' or \'confirmed\') is '.(GETPOST('clean_product_stock_batch','alpha')?GETPOST('clean_product_stock_batch','alpha'):'0').'
'."\n";
print 'Option set_empty_time_spent_amount (0 or \'test\' or \'confirmed\') is '.(GETPOST('set_empty_time_spent_amount','alpha')?GETPOST('set_empty_time_spent_amount','alpha'):'0').'
'."\n";
print 'Option rebuild_product_thumbs (0 or \'test\' or \'confirmed\') is '.(GETPOST('rebuild_product_thumbs','alpha')?GETPOST('rebuild_product_thumbs','alpha'):'0').'
'."\n";
+print 'Option force_disable_of_modules_not_found (0 or \'test\' or \'confirmed\') is '.(GETPOST('force_disable_of_modules_not_found','alpha')?GETPOST('force_disable_of_modules_not_found','alpha'):'0').'
'."\n";
print '
';
print '
*** Force modules not found to be disabled | |
| '; + print $majname; + + $db->begin(); + + if (preg_match('/MAIN_MODULE_(.*)_HOOKS/i', $majname, $reg)) + { + $name=strtolower($reg[1]); + + if ($name) + { + $reloffile=$name.'/class/actions_'.$name.'.class.php'; + $result = dol_include_once($reloffile); + if (! $result) + { + print ' - File of hooks ('.$reloffile.') NOT found, we disable the module.'; + if (GETPOST('force_disable_of_modules_not_found') == 'confirmed') + { + $sql2 ="DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_MODULE_".strtoupper($name)."_HOOKS'"; + $resql2=$db->query($sql2); + if (! $resql2) + { + $error++; + dol_print_error($db); + } + $sql2 ="DELETE FROM ".MAIN_DB_PREFIX."const WHERE name = 'MAIN_MODULE_".strtoupper($name)."'"; + $resql2=$db->query($sql2); + if (! $resql2) + { + $error++; + dol_print_error($db); + } + else + print " - Cleaned"; + } + else + { + print ' - Canceled (test mode)'; + } + } + else + { + print ' - File of hooks ('.$reloffile.') found, we do nothing.'; + } + } + + if (!$error) $db->commit(); + else $db->rollback(); + } + + print' | |
| No active module with missing files found | |