aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2012-08-27 18:43:05 +0000
committerrvelices <rv-github@modusoptimus.com>2012-08-27 18:43:05 +0000
commit391ac76cbea0e091534861c884d0e40761f0fba7 (patch)
tree5d88a57e31fbe2913f7dd9212ffe8e0e54e0efa1
parent4bcacb8c698d35ddf3603ccfbdec12aec3860a5b (diff)
merge -r17650 from trunk to branch 2.4 bug 2730: multi size not deleted when physical directory deleted
git-svn-id: http://piwigo.org/svn/branches/2.4@17651 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/site_update.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/admin/site_update.php b/admin/site_update.php
index 40faec33e..eee9453f0 100644
--- a/admin/site_update.php
+++ b/admin/site_update.php
@@ -303,19 +303,31 @@ SELECT id_uppercat, MAX(rank)+1 AS next_rank
}
// to delete categories
- $to_delete = array();
+ $to_delete = array(); $to_delete_derivative_dirs = array();
foreach (array_diff(array_keys($db_fulldirs), $fs_fulldirs) as $fulldir)
{
array_push($to_delete, $db_fulldirs[$fulldir]);
unset($db_fulldirs[$fulldir]);
array_push($infos, array('path' => $fulldir,
'info' => l10n('deleted')));
+ if (substr_compare($fulldir, '../', 0, 3)==0)
+ {
+ $fulldir = substr($fulldir, 3);
+ }
+ $to_delete_derivative_dirs[] = PHPWG_ROOT_PATH.PWG_DERIVATIVE_DIR.$fulldir;
}
if (count($to_delete) > 0)
{
if (!$simulate)
{
delete_categories($to_delete);
+ foreach($to_delete_derivative_dirs as $to_delete_dir)
+ {
+ if (is_dir($to_delete_dir))
+ {
+ clear_derivative_cache_rec($to_delete_dir, '#.+#');
+ }
+ }
}
$counts['del_categories'] = count($to_delete);
}