Skip to content

Commit

Permalink
Dont increment if no image was found
Browse files Browse the repository at this point in the history
  • Loading branch information
LuomaJuha committed Oct 25, 2024
1 parent 55bb5dc commit d1b678a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions module/Finna/src/Finna/View/Helper/Root/RecordImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -501,11 +501,10 @@ public function getImagesForBotUser(array $images = []): array
$results[] = [
'url' => $image['urls'][$size],
'pdf' => !empty($image['pdf']),
'id' => $i,
'id' => $i++,
];
break;
}
$i++;
} while ($i < 4 && $image = array_shift($images));
return $results;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<?php if ($image['pdf']): ?>
<a href="<?=$this->escapeHtmlAttr($image['url'])?>"><?=$this->escapeHtml($image['id']);?></a>
<?php else: ?>
<img src="<?=$this->escapeHtmlAttr($image['url'])?>"><?=$this->escapeHtml($image['id']);?></img>
<img src="<?=$this->escapeHtmlAttr($image['url'])?>">
<?php endif;?>
<?php
endforeach;
Expand Down

0 comments on commit d1b678a

Please sign in to comment.