Explorar o código

Ticket #4290 - Templates with Styles: Images aren't saved correctly.

AntonLV %!s(int64=3) %!d(string=hai) anos
pai
achega
da2df98946
Modificáronse 1 ficheiros con 6 adicións e 6 borrados
  1. 6 6
      studio/classes/BxDolStudioOptions.php

+ 6 - 6
studio/classes/BxDolStudioOptions.php

@@ -350,8 +350,8 @@ class BxDolStudioOptions extends BxDol
             case 'image':
             case 'image':
                 $mixedValue = (int)getParam($aOption['name']);
                 $mixedValue = (int)getParam($aOption['name']);
 
 
-                $aIds = $oForm->getCleanValue($aOption['name']);
-                if(empty($aIds)) {
+                $mixedIds = $oForm->getCleanValue($aOption['name']);
+                if(empty($mixedIds)) {
                     if(!empty($mixedValue))
                     if(!empty($mixedValue))
                         $mixedValue = 0;
                         $mixedValue = 0;
 
 
@@ -364,10 +364,10 @@ class BxDolStudioOptions extends BxDol
 
 
                 //--- Concatenation integer values as strings is required to get unique content id
                 //--- Concatenation integer values as strings is required to get unique content id
                 $iContentId = (int)($aOption['id'] . (int)$oForm->getCleanValue('mix_id'));
                 $iContentId = (int)($aOption['id'] . (int)$oForm->getCleanValue('mix_id'));
-                foreach($aIds as $iId) {
-                    $oStorage->updateGhostsContentId($iId, false, $iContentId);
-                    $mixedValue = $iId;
-                }
+                $iImageId = is_array($mixedIds) ? (int)array_shift($mixedIds) : (int)$mixedIds;
+
+                $oStorage->updateGhostsContentId($iImageId, false, $iContentId);
+                $mixedValue = $iImageId;
                 break;
                 break;
 
 
             default: 
             default: