Skip to content
Snippets Groups Projects
Commit a96ab9a5 authored by Regis Houssin's avatar Regis Houssin
Browse files

Fix: missing parameters !

parent a26e0336
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,8 @@ function checkElementExist($id, $table)
$num = $db->num_rows($resql);
if ($num > 0) return true;
else return false;
}
}
else return true; // for security
}
/**
......@@ -56,6 +57,9 @@ function checkLinkedElements($sourcetype, $targettype)
$elements=array();
$deleted=0;
$sourcetable=$sourcetype;
$targettable=$targettype;
if ($sourcetype == 'shipping') $sourcetable = 'expedition';
else if ($targettype == 'shipping') $targettable = 'expedition';
if ($sourcetype == 'delivery') $sourcetable = 'livraison';
......@@ -88,7 +92,7 @@ function checkLinkedElements($sourcetype, $targettype)
if (! empty($elements))
{
foreach($elements as $key => $element)
{
{
if (! checkElementExist($element[$sourcetype], $sourcetable) || ! checkElementExist($element[$targettype], $targettable))
{
$sql = 'DELETE FROM '.MAIN_DB_PREFIX .'element_element';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment