aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2016-01-26 15:41:12 +0100
committerplegall <plg@piwigo.org>2016-01-26 15:41:12 +0100
commit7ae2094726e94ae9662a53ff554c916a40b4283c (patch)
tree746388f2748979a1c3b5a1c60ac664c393a3c11f
parent74dd9b88edc7bff65bd34e8bca91f8838600fd3a (diff)
bug #407 fixed, avoid PHP warnings
... on formats_to_delete and caddiables variables during sync
-rw-r--r--admin/site_update.php15
1 files changed, 7 insertions, 8 deletions
diff --git a/admin/site_update.php b/admin/site_update.php
index f13682e09..ad3ccba19 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -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);