From d15f4f58e70e33dd55b72a36c9fa05b01b458c16 Mon Sep 17 00:00:00 2001 From: Gilles Crettenand Date: Mon, 1 Jun 2015 15:05:41 +0200 Subject: [PATCH] book code is padded to 5 digits by checkfile --- mobile.netbiblio.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mobile.netbiblio.php b/mobile.netbiblio.php index 80b1186..ebfe333 100644 --- a/mobile.netbiblio.php +++ b/mobile.netbiblio.php @@ -323,9 +323,10 @@ class NetBiblio extends WebService if(count($files) > 0) { foreach($booksWithoutFiles as $k => $b) { - if(isset($files[$b['code']])) { - $books[$k]['files'] = $files[$b['code']]; - $files[$b['code']]['id'] = $b['id']; + $fileCode = sprintf("%05u", $b['code']); + if(isset($files[$fileCode])) { + $books[$k]['files'] = $files[$fileCode]; + $files[$fileCode]['id'] = $b['id']; } else { // we need to have an empty array for mobile apps compatibility. $books[$k]['files'] = array();