diff options
author | vdigital <vdigital@piwigo.org> | 2008-05-16 20:03:30 +0000 |
---|---|---|
committer | vdigital <vdigital@piwigo.org> | 2008-05-16 20:03:30 +0000 |
commit | 3e4f14d0092ad18624fdcbe8135ddaa4bf6a09d7 (patch) | |
tree | 6077729d1f9ac4db63fc3bdbc0a9fe821d39c39b | |
parent | dc2adc5b614a43179eda505eb13d0de5f6fa10d2 (diff) |
Logical merge from 1.7.1 Revison 2193
Bug with no ref (and maybe 663): Currently if the "Search in subcategories" checkbox was unselected, all existing categories and elements were duplicated.
Cause: Wrong comparison between fileserver directory list and already known files in tables.
Resolution: keeping only the selected directory from the file server directory list in such cases,
if that one is still allocated.
git-svn-id: http://piwigo.org/svn/trunk@2344 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r-- | admin/site_update.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/admin/site_update.php b/admin/site_update.php index 8dcf601d2..e6fb6d4ef 100644 --- a/admin/site_update.php +++ b/admin/site_update.php @@ -235,7 +235,14 @@ SELECT IF(MAX(id)+1 IS NULL, 1, MAX(id)+1) AS next_id { array_push($fs_fulldirs, $basedir); } - + // If $_POST['subcats-included'] != 1 ("Search in subcategories" is unchecked) + // $db_fulldirs doesn't include any subdirectories and $fs_fulldirs does + // So $fs_fulldirs will be limited to the selected basedir + // (if that one is in $fs_fulldirs) + if (!isset($_POST['subcats-included']) or $_POST['subcats-included'] != 1) + { + $fs_fulldirs = array_intersect($fs_fulldirs, array_keys($db_fulldirs)); + } $inserts = array(); // new categories are the directories not present yet in the database foreach (array_diff($fs_fulldirs, array_keys($db_fulldirs)) as $fulldir) |