bug #407 fixed, avoid PHP warnings
... on formats_to_delete and caddiables variables during sync
This commit is contained in:
parent
74dd9b88ed
commit
7ae2094726
1 changed files with 7 additions and 8 deletions
|
@ -488,6 +488,7 @@ SELECT id, path
|
|||
$inserts = array();
|
||||
$insert_links = array();
|
||||
$insert_formats = array();
|
||||
$formats_to_delete = array();
|
||||
|
||||
foreach (array_diff(array_keys($fs), $db_elements) as $path)
|
||||
{
|
||||
|
@ -593,8 +594,6 @@ SELECT *
|
|||
}
|
||||
|
||||
// first we search the formats that were removed
|
||||
$formats_to_delete = array();
|
||||
|
||||
foreach ($db_formats as $image_id => $formats)
|
||||
{
|
||||
$image_formats_to_delete = array_diff_key($formats, $fs[ $db_elements[$image_id] ]['formats']);
|
||||
|
@ -658,6 +657,12 @@ SELECT *
|
|||
array_keys($insert_links[0]),
|
||||
$insert_links
|
||||
);
|
||||
|
||||
// add new photos to caddie
|
||||
if (isset($_POST['add_to_caddie']) and $_POST['add_to_caddie'] == 1)
|
||||
{
|
||||
fill_caddie($caddiables);
|
||||
}
|
||||
}
|
||||
|
||||
// inserts all formats
|
||||
|
@ -679,12 +684,6 @@ DELETE
|
|||
;';
|
||||
pwg_query($query);
|
||||
}
|
||||
|
||||
// add new photos to caddie
|
||||
if (isset($_POST['add_to_caddie']) and $_POST['add_to_caddie'] == 1)
|
||||
{
|
||||
fill_caddie($caddiables);
|
||||
}
|
||||
}
|
||||
|
||||
$counts['new_elements'] = count($inserts);
|
||||
|
|
Loading…
Reference in a new issue