Fixed level 7!

This commit is contained in:
James Cole
2025-01-04 19:25:43 +01:00
parent 23178614d5
commit 1aa8ebe57f
8 changed files with 32 additions and 23 deletions

View File

@@ -118,7 +118,7 @@ class ShowController extends Controller
if (null !== $array['nr_of_repetitions']) {
$left = $array['nr_of_repetitions'] - $array['journal_count'];
$left = max(0, $left);
$left = (int) max(0, $left);
// limit each repetition to X occurrences:
foreach ($array['repetitions'] as $index => $repetition) {
$array['repetitions'][$index]['occurrences'] = array_slice($repetition['occurrences'], 0, $left);