]> _ Git - pmi.git/commitdiff
wip #3269 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 13 Dec 2019 15:32:55 +0000 (16:32 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 13 Dec 2019 15:32:55 +0000 (16:32 +0100)
app/Models/Product.php

index 54fce9bf76a9cf5518d2c1abb293df771465f55d..3466a37a6cca3bc9ace179a83f6c6628bb5a4458 100644 (file)
@@ -146,7 +146,8 @@ class Product extends CubistMagicPageModel
     }
 
     // Image handling
-    public function registerMediaConversions(Media $media = null) {
+    public function registerMediaConversions(Media $media = null)
+    {
 
         parent::registerMediaConversions($media);
 
@@ -527,8 +528,13 @@ class Product extends CubistMagicPageModel
                     }
 
 
-                    $fvmax = $filter_value[1];
-                    $fvmin = $filter_value[0];
+                    if (null !== $filter_value) {
+                        $fvmax = $filter_value[1];
+                        $fvmin = $filter_value[0];
+                    } else {
+                        $fvmax = PHP_INT_MAX;
+                        $fvmin = PHP_INT_MIN;
+                    }
 
                     if ($f['scale'] == 'log') {
                         $fvmax = safeExp($fvmax);
@@ -618,7 +624,7 @@ function safeLog($v)
         $res = log10($v);
     }
 
-    return round($res,8);
+    return round($res, 8);
 }
 
 function safeExp($log)