From dee71a16840dac08cfd681c8fc07e085e6016ec6 Mon Sep 17 00:00:00 2001 From: scyrma Date: Mon, 25 Feb 2008 02:50:21 +0000 Subject: [PATCH] MDL-13630 - merge from 1.9 --- tag/edit.php | 2 +- tag/lib.php | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tag/edit.php b/tag/edit.php index 33294df4e2..6ee097a9da 100644 --- a/tag/edit.php +++ b/tag/edit.php @@ -15,7 +15,7 @@ if (empty($CFG->usetags)) { $tag_id = optional_param('id', 0, PARAM_INT); $tag_name = optional_param('tag', '', PARAM_TAG); if ($tag_name) { - $tag = array_shift(tag_get_id($tag_name, TAG_RETURN_OBJECT)); + $tag = tag_get_id($tag_name, TAG_RETURN_OBJECT); } elseif ( $tag_id ) { $tag = tag_get_tag_by_id($tag_id); } else { diff --git a/tag/lib.php b/tag/lib.php index d6a1b53323..96d7de5986 100644 --- a/tag/lib.php +++ b/tag/lib.php @@ -245,9 +245,13 @@ function tag_get_tags_ids($record) { * Returns the database ID of a set of tags. * * @param mixed $tags one tag, or array of tags, to look for. - * @param bool $return_object get the object returned by get_recordset_sql instead - * of the id only (default: false) - * @return mixed tag-indexed array of ids (or objects, if second parameter is TAG_RETURN_OBJECT), or only an int, if only one tag is given *and* the second parameter is null. No value for a key means the tag wasn't found. + * @param bool $return_value specify the type of the returned value. Either + * TAG_RETURN_OBJECT, or TAG_RETURN_ARRAY (default). If TAG_RETURN_ARRAY + * is specified, an array will be returned even if only one tag was + * passed in $tags. + * @return mixed tag-indexed array of ids (or objects, if second parameter is + * TAG_RETURN_OBJECT), or only an int, if only one tag is given *and* the + * second parameter is null. No value for a key means the tag wasn't found. */ function tag_get_id($tags, $return_value=null) { global $CFG; -- 2.39.5