]> _ Git - cubist_cms-back.git/commitdiff
wip #4876 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 18 Jan 2022 12:48:10 +0000 (13:48 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 18 Jan 2022 12:48:10 +0000 (13:48 +0100)
src/app/Magic/Models/CubistMagicAbstractModel.php

index 3cbcd39a1188dce4a2ace4b53bdfa0598bf9aded..f4e8b7607c1dcf9069b7333b6f072c3e50137417 100644 (file)
@@ -707,7 +707,12 @@ class CubistMagicAbstractModel extends Model implements HasMedia
         if (null === $c || !$c) {
             return [];
         }
-        return $this->getMedia($c);
+        $res = $this->getMedia($c);
+        if ($res->count() === 0 && $this->hasField($c)) {
+            $c = $this->getAttribute($c);
+            $res = $this->getMedia($c);
+        }
+        return $res;
     }
 
     public function deleteMediaInField($c)