Fix: We must run the migrate for element_element only if we migrate to 2.8.x serie

This commit is contained in:
Laurent Destailleur 2009-12-23 15:26:29 +00:00
parent 0bc8ad6a2f
commit 6f6caf60de
4 changed files with 89 additions and 83 deletions

View File

@ -253,9 +253,9 @@ function conf($dolibarr_main_document_root)
/* /*
* \brief Affiche entete HTML * \brief Show header of install pages
*/ */
function pHeader($soutitre,$next,$action='set') function pHeader($soutitre,$next,$action='set',$param='')
{ {
global $conf; global $conf;
global $langs; global $langs;
@ -279,7 +279,7 @@ function pHeader($soutitre,$next,$action='set')
} }
print '</span>'."\n"; print '</span>'."\n";
print '<form action="'.$next.'.php" method="POST">'."\n"; print '<form action="'.$next.'.php'.($param?'?'.$param:'').'" method="POST">'."\n";
print '<input type="hidden" name="testpost" value="ok">'."\n"; print '<input type="hidden" name="testpost" value="ok">'."\n";
print '<input type="hidden" name="action" value="'.$action.'">'."\n"; print '<input type="hidden" name="action" value="'.$action.'">'."\n";

View File

@ -67,7 +67,7 @@ if (! is_object($conf)) dolibarr_install_syslog("upgrade2: conf file not initial
* View * View
*/ */
pHeader('',"upgrade2",$_REQUEST['action']); pHeader('',"upgrade2",$_REQUEST['action'],'versionfrom='.$versionfrom.'&versionto='.$versionto);
$actiondone=0; $actiondone=0;

View File

@ -53,6 +53,8 @@ error_reporting($err);
$setuplang=isset($_POST['selectlang'])?$_POST['selectlang']:(isset($_GET['selectlang'])?$_GET['selectlang']:'auto'); $setuplang=isset($_POST['selectlang'])?$_POST['selectlang']:(isset($_GET['selectlang'])?$_GET['selectlang']:'auto');
$langs->setDefaultLang($setuplang); $langs->setDefaultLang($setuplang);
$versionfrom=isset($_POST["versionfrom"])?$_POST["versionfrom"]:(isset($_GET["versionfrom"])?$_GET["versionfrom"]:'');
$versionto=isset($_POST["versionto"])?$_POST["versionto"]:(isset($_GET["versionto"])?$_GET["versionto"]:'');
$langs->load('admin'); $langs->load('admin');
$langs->load('install'); $langs->load('install');
@ -74,7 +76,7 @@ if (! is_object($conf)) dolibarr_install_syslog("upgrade2: conf file not initial
* Actions * Actions
*/ */
pHeader('','etape5',$_REQUEST["action"]); pHeader('','etape5',$_REQUEST["action"],'versionfrom='.$versionfrom.'&versionto='.$versionto);
if (isset($_POST['action']) && preg_match('/upgrade/i',$_POST["action"])) if (isset($_POST['action']) && preg_match('/upgrade/i',$_POST["action"]))
@ -234,10 +236,10 @@ if (isset($_POST['action']) && preg_match('/upgrade/i',$_POST["action"]))
migrate_directories($db,$langs,$conf,'/societe','/mycompany'); migrate_directories($db,$langs,$conf,'/societe','/mycompany');
// Script pour V2.7 -> V2.8 // Script for -> V2.8
$toversionarray=array('2.8.0'); $afterversionarray=array('2.7.9');
//$dolibarrlastupgradeversionarray=array('2.7.0'); $beforeversionarray=array('2.8.9');
if (versioncompare($toversionarray,$dolibarrlastupgradeversionarray) > 0) if (versioncompare($versionto,$afterversionarray) >= 0 && versioncompare($versionto,$beforeversionarray) <= 0)
{ {
migrate_relationship_tables($db,$langs,$conf,'co_exp','fk_commande','commande','fk_expedition','shipping'); migrate_relationship_tables($db,$langs,$conf,'co_exp','fk_commande','commande','fk_expedition','shipping');

View File

@ -145,6 +145,10 @@ function run_sql($sqlfile,$silent=1,$entity='')
if ($buffer) $arraysql[$i]=trim($buffer); if ($buffer) $arraysql[$i]=trim($buffer);
fclose($fp); fclose($fp);
} }
else
{
dol_syslog("Admin.lib::run_sql failed to open file ".$sqlfile, LOG_ERR);
}
// Loop on each request to see if there is a __+MAX_table__ key // Loop on each request to see if there is a __+MAX_table__ key
$listofmaxrowid=array(); $listofmaxrowid=array();