]> gitweb.erp-flowers.ru Git - erp24_rep/yii-erp24/.git/commitdiff
ERP-417
authormarina <m.zozirova@gmail.com>
Wed, 28 May 2025 09:52:35 +0000 (12:52 +0300)
committermarina <m.zozirova@gmail.com>
Wed, 28 May 2025 09:52:35 +0000 (12:52 +0300)
erp24/views/write_offs_erp/_form.php

index fefe018817e1837a2d99caabdf42233cc1a4e66d..797225677b2d7954cf0fb82e5f285252e310d85a 100644 (file)
@@ -245,8 +245,9 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View
                     'type' => FileInput::className(),
                     'options' => function ($data) {
                         $videoUrl = null;
+                        $deleteUrl = '#';
 
-                        if (!empty($data['id'])) {
+                        if (is_array($data) && !empty($data['id'])) {
                             $videoUrl = Files::find()
                                 ->select('url')
                                 ->where([
@@ -254,9 +255,9 @@ $this->registerJsFile('/js/heic_to_jpg_replace.js', ['position' => \yii\web\View
                                     'entity_id' => $data['id']
                                 ])
                                 ->scalar();
-                        }
 
-                        $deleteUrl = Url::to(['write-offs-erp/delete-video', 'id' => $data['id']]);
+                            $deleteUrl = Url::to(['write-offs-erp/delete-video', 'id' => $data['id']]);
+                        }
 
                         return [
                             'options' => [