book code is padded to 5 digits by checkfile

This commit is contained in:
Gilles Crettenand
2015-06-01 15:05:41 +02:00
parent d6b20627fd
commit d15f4f58e7

View File

@@ -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();