Browse Source

Fix for export

Laurent Destailleur 1 year ago
parent
commit
c66b434c80

+ 6 - 0
htdocs/admin/tools/dolibarr_export.php

@@ -279,6 +279,12 @@ if (in_array($type, array('mysql', 'mysqli'))) {
 	print '</label>';
 	print '<br>';
 
+	print '<input type="checkbox" name="use_force" value="no" id="checkbox_use_force" />';
+	print '<label for="checkbox_use_force">';
+	print $form->textwithpicto($langs->trans('ExportUseForce'), $langs->trans('ExportUseForceHelp'));
+	print '</label>';
+	print '<br>';
+
 	$execmethod = 0;
 	if (getDolGlobalString('MAIN_EXEC_USE_POPEN')) {
 		$execmethod = $conf->global->MAIN_EXEC_USE_POPEN;

+ 3 - 0
htdocs/core/class/utils.class.php

@@ -322,6 +322,9 @@ class Utils
 			if (GETPOST("use_mysql_quick_param", "alpha")) {
 				$param .= " --quick";
 			}
+			if (GETPOST("use_force", "alpha")) {
+				$param .= " -f";
+			}
 			if (GETPOST("sql_structure", "alpha") || $usedefault) {
 				if (GETPOST("drop", "alpha") || $usedefault) {
 					$param .= " --add-drop-table=TRUE";

+ 2 - 0
htdocs/langs/en_US/admin.lang

@@ -2440,3 +2440,5 @@ ParametersForTestEnvironment=Parameters for test environment
 TryToKeepOnly=Try to keep only %s
 RecommendedForProduction=Recommended for Production
 RecommendedForDebug=Recommended for Debug
+ExportUseForce=Use the parameter -f
+ExportUseForceHelp=Force to continue the export even when an error is found (Backup may not be reliable)