From b205a3127cc9df1ec3c2c8f2289083ecde2f8a9a Mon Sep 17 00:00:00 2001 From: marina Date: Mon, 26 May 2025 10:38:43 +0300 Subject: [PATCH] ERP-417 --- erp24/views/write_offs_erp/_form.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/erp24/views/write_offs_erp/_form.php b/erp24/views/write_offs_erp/_form.php index ccc521ed..049b24bf 100644 --- a/erp24/views/write_offs_erp/_form.php +++ b/erp24/views/write_offs_erp/_form.php @@ -288,10 +288,14 @@ JS 'title' => 'Видео: mp4, mov, avi', 'type' => FileInput::className(), 'value' => function ($data) { + if ($data === null || !isset($data['id'])) { + return null; + } + $file = Files::findOne([ - 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO, - 'entity_id' => $data['id'] - ]); + 'entity' => WriteOffsProductsErp::WRITE_OFFS_VIDEO, + 'entity_id' => $data['id'] + ]); return $file ? basename($file->url) : null; }, 'options' => [ -- 2.39.5