From 61338a3575bb0c71054c9af549f46b63a3949ca3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pau=20Ferrer=20Oca=C3=B1a?= Date: Tue, 23 Sep 2014 11:24:13 +0200 Subject: [PATCH] Solved problem when receiving only one book from Marsupial publishers --- moodle/moodle2/local/rcommon/WebServices/BooksStructure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/moodle/moodle2/local/rcommon/WebServices/BooksStructure.php b/moodle/moodle2/local/rcommon/WebServices/BooksStructure.php index f71c4ac..1b86244 100755 --- a/moodle/moodle2/local/rcommon/WebServices/BooksStructure.php +++ b/moodle/moodle2/local/rcommon/WebServices/BooksStructure.php @@ -47,7 +47,7 @@ function get_books_structure_publisher($publisher, $isbn = false) { $books = get_books($publisher); if(!empty($books)){ // Fix bug, when there is just one received book - if (!isset($books[0])) { + if (!is_array($books) || !isset($books[0])) { $books = array($books); } echo '
    ';