aboutsummaryrefslogtreecommitdiffstats
path: root/admin/cat_modify.php
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2011-11-07 10:52:46 +0000
committerplegall <plg@piwigo.org>2011-11-07 10:52:46 +0000
commit49375a54a2d229ce88865e5becc1912d480390f0 (patch)
tree36b6ad0c9e3b4cf41ddddaf5008dc1f64edef345 /admin/cat_modify.php
parent79c03f14408183d87e363bdd90e76fd8a3111835 (diff)
bug 2491 fixed: on album admin screen, don't display "1 album moved" message
when the album is not really moved. git-svn-id: http://piwigo.org/svn/branches/2.3@12575 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'admin/cat_modify.php')
-rw-r--r--admin/cat_modify.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/admin/cat_modify.php b/admin/cat_modify.php
index 3c944ce7b..5b29a85d9 100644
--- a/admin/cat_modify.php
+++ b/admin/cat_modify.php
@@ -75,7 +75,15 @@ if (isset($_POST['submit']))
set_cat_status(array($_GET['cat_id']), $_POST['status']);
}
- if (isset($_POST['parent']) and $cat_info['id_uppercat'] != $_POST['parent'])
+ // in case the use moves his album to the gallery root, we force
+ // $_POST['parent'] from 0 to null to be compared with
+ // $cat_info['id_uppercat']
+ if (empty($_POST['parent']))
+ {
+ $_POST['parent'] = null;
+ }
+
+ if ($cat_info['id_uppercat'] != $_POST['parent'])
{
move_categories( array($_GET['cat_id']), $_POST['parent'] );
}