]> _ Git - fluidbook-toolbox.git/commitdiff
wait #7784 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Oct 2025 08:57:14 +0000 (10:57 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 10 Oct 2025 08:57:14 +0000 (10:57 +0200)
app/Fluidbook/Compiler/Cart.php

index 7ba5f64dec6081a73d94685a3847853040011c3e..c6b81591c692887936e1c18ddb462356b196b5a1 100644 (file)
@@ -276,11 +276,15 @@ trait Cart
         $cdir = $this->wdir . '/commerce/';
 
         $file = $cdir . $this->fluidbookSettings->basketReferences;
+        $refmtime = filemtime($file);
         $this->config->basketReferences = ExcelToArray::excelToArrayKeyVars($file);
 
         foreach ($this->config->basketReferences as $ref => $data) {
             $dest = $cdir . $ref . '.jpg';
-            if (!file_exists($dest)) {
+            if (is_link($dest)) {
+                unlink($dest);
+            }
+            if (!file_exists($dest) || filemtime($dest) < $refmtime) {
                 if (!@copy($data['img'], $dest)) {
                     $dest = $this->wdir . '/default.jpg';
                 }