]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7212 @0.25
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Nov 2024 16:57:47 +0000 (17:57 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 27 Nov 2024 16:57:47 +0000 (17:57 +0100)
app/Fluidbook/Compiler/Compiler.php

index aa981954b9c794d7ec790c46086a58720f0249ab..99d925c9b73ae24c7e3b7cef8d85a7a713e2c213 100644 (file)
@@ -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);
             }
         }