From 3f18fd5dab759e5b665cb706b3378ac460443a27 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 27 Nov 2024 17:57:47 +0100 Subject: [PATCH] wait #7212 @0.25 --- app/Fluidbook/Compiler/Compiler.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/app/Fluidbook/Compiler/Compiler.php b/app/Fluidbook/Compiler/Compiler.php index aa981954b..99d925c9b 100644 --- a/app/Fluidbook/Compiler/Compiler.php +++ b/app/Fluidbook/Compiler/Compiler.php @@ -1512,10 +1512,19 @@ class Compiler extends Base implements CompilerInterface, IVirtualDirectoryError $p = $this->parseVariables($this->fluidbookSettings->gamify_coins_pages); foreach ($p as $range => $coins) { $pages = ArrayUtil::parseRange($range); - foreach ($pages as $page) { - if ($this->isDoublePage() && $page % 2 === 1 && $page > 1) { - continue; + if ($this->isDoublePage()) { + $evenPages = []; + foreach ($pages as $page) { + if ($page % 2 === 1) { + $page--; + } + $evenPages[] = $page; } + $pages = array_unique($evenPages); + } + + + foreach ($pages as $page) { $this->config->set('gamifyCoins.visit_page_' . $page, $coins); } } -- 2.39.5