瀏覽代碼

#3828 - PHP 8.1 compatibility: create video page

Alex Trofimov 4 年之前
父節點
當前提交
1990a4fd91
共有 1 個文件被更改,包括 7 次插入 和 1 次删除
  1. 7 1
      modules/boonex/videos/classes/BxVideosFormEntry.php

+ 7 - 1
modules/boonex/videos/classes/BxVideosFormEntry.php

@@ -239,7 +239,11 @@ class BxVideosFormEntry extends BxBaseModTextFormEntry
 
     public function genCustomRowVideoEmbed(&$aInput) {
         $sSource = isset($this->aInputs['video_source']) && $this->aInputs['video_source']['value'] == 'embed' ? 'embed' : 'upload';
-        if ($sSource != 'embed') $aInput['tr_attrs']['style'] = 'display:none';
+        if ($sSource != 'embed') {
+            if (!is_array($aInput['tr_attrs']))
+                $aInput['tr_attrs'] = [];
+            $aInput['tr_attrs']['style'] = 'display:none';
+        }
         return $this->genRowStandard($aInput);
     }
 
@@ -281,6 +285,8 @@ class BxVideosFormEntry extends BxBaseModTextFormEntry
         $sJsCode = '';
 
         if ($aInput['name'] == 'video_source' && $aInput['type'] == 'radio_set') {
+            if (!is_array($aInput['attrs']))
+                $aInput['attrs'] = [];
             $aInput['attrs']['onchange'] = $this->_oModule->_oConfig->getJsObject('embeds').'.changeVideoSource(this.value);';
             $sJsCode = '';
             if ($this->_bDynamicMode) {