Fix: Corrige pb sur passage script migration si contient des requetes vides (lignes de blanc)
This commit is contained in:
parent
0c1e1e1a8c
commit
0ce24b707b
@ -147,20 +147,22 @@ if (isset($_GET["action"]) && $_GET["action"] == "upgrade")
|
|||||||
if (eregi(';',$buffer))
|
if (eregi(';',$buffer))
|
||||||
{
|
{
|
||||||
// Found new request
|
// Found new request
|
||||||
$arraysql[$i]=$buffer;
|
$arraysql[$i]=trim($buffer);
|
||||||
$i++;
|
$i++;
|
||||||
$buffer='';
|
$buffer='';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($buffer) $arraysql[$i]=$buffer;
|
if ($buffer) $arraysql[$i]=trim($buffer);
|
||||||
fclose($fp);
|
fclose($fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop on each request
|
// Loop on each request
|
||||||
foreach($arraysql as $i=>$sql)
|
foreach($arraysql as $i=>$sql)
|
||||||
{
|
{
|
||||||
|
if ($sql)
|
||||||
|
{
|
||||||
// print '<tr><td>'.$langs->trans("Request").' '.$i.'</td>';
|
// print '<tr><td>'.$langs->trans("Request").' '.$i.'</td>';
|
||||||
|
print("Execution de requete=".($i+1)." sql='".$sql."'<br>\n");
|
||||||
if ($db->query($sql))
|
if ($db->query($sql))
|
||||||
{
|
{
|
||||||
// print '<td align="right">OK</td>';
|
// print '<td align="right">OK</td>';
|
||||||
@ -178,11 +180,11 @@ if (isset($_GET["action"]) && $_GET["action"] == "upgrade")
|
|||||||
);
|
);
|
||||||
if (in_array($errno,$okerror))
|
if (in_array($errno,$okerror))
|
||||||
{
|
{
|
||||||
// print '<td align="right">'.$langs->trans("OK").'</td>';
|
// print '<td align="right">'.$langs->trans("OK").'</td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print '<tr><td valign="top">'.$langs->trans("Request").' '.$i.'</td>';
|
print '<tr><td valign="top">'.$langs->trans("Request").' '.($i+1).'</td>';
|
||||||
print '<td valign="top">'.$langs->trans("Error")." ".$db->errno()." ".$sql."<br>".$db->error()."</td>";
|
print '<td valign="top">'.$langs->trans("Error")." ".$db->errno()." ".$sql."<br>".$db->error()."</td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
$error++;
|
$error++;
|
||||||
@ -191,6 +193,7 @@ if (isset($_GET["action"]) && $_GET["action"] == "upgrade")
|
|||||||
|
|
||||||
// print '</tr>';
|
// print '</tr>';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user