From f4f4f9724a480a4336af547c3a0ff814924f0acc Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 3 Dec 2008 23:27:46 +0000 Subject: 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/branches/2.0@2921 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/ws_functions.inc.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/ws_functions.inc.php') diff --git a/include/ws_functions.inc.php b/include/ws_functions.inc.php index ce91e7489..d6f032df3 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