From 352e256d4150b6a29b0c1640c1f876d0b7a009fc Mon Sep 17 00:00:00 2001 From: plegall Date: Thu, 18 Aug 2022 11:34:37 +0200 Subject: [PATCH] details about the new input parameter position for pwg.categories.add --- include/ws_functions/pwg.categories.php | 2 +- ws.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/ws_functions/pwg.categories.php b/include/ws_functions/pwg.categories.php index f98c2eb34..2763ad20b 100644 --- a/include/ws_functions/pwg.categories.php +++ b/include/ws_functions/pwg.categories.php @@ -576,7 +576,7 @@ function ws_categories_add($params, &$service) global $conf; - if ($params["position"] != "") + if (!empty($params['position']) and in_array($params['position'], array('first','last'))) { //TODO make persistent with user prefs $conf['newcat_default_position'] = $params["position"]; diff --git a/ws.php b/ws.php index b3d9d507e..6cb3428cf 100644 --- a/ws.php +++ b/ws.php @@ -611,7 +611,7 @@ function ws_addDefaultMethods( $arr ) 'info'=>'public, private'), 'commentable' => array('default'=>true, 'type'=>WS_TYPE_BOOL), - 'position' => array('default'=>null), + 'position' => array('default'=>null, 'info'=>'first, last'), ), 'Adds an album.', $ws_functions_root . 'pwg.categories.php',