diff options
Diffstat (limited to '')
-rw-r--r-- | admin/cat_modify.php | 10 |
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'] ); } |