From 0479bcde106ec3a016c28f2fce458c4b09b1a664 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 3 Dec 2008 23:29:08 +0000 Subject: merge r2921 from branch 2.0 to trunk bug 907 fixed: avoid PHP warning when pwg.images.add adds a photo in a category that either contains no "ranked" image or when category is empty. git-svn-id: http://piwigo.org/svn/trunk@2922 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions.inc.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index 0993008f1..ed0bbbda1 100644 --- a/include/ws_functions.inc.php +++ b/include/ws_functions.inc.php @@ -1613,6 +1613,11 @@ SELECT foreach ($cat_ids as $cat_id) { + if (!isset($current_rank_of[$cat_id])) + { + $current_rank_of[$cat_id] = 0; + } + if ('auto' == $rank_on_category[$cat_id]) { $rank_on_category[$cat_id] = $current_rank_of[$cat_id] + 1; -- cgit v1.2.3