From b95234f422cfb02732d86c2ac86c7b5f2c866d45 Mon Sep 17 00:00:00 2001 From: githubjeka Date: Fri, 26 Oct 2018 09:22:40 +0300 Subject: [PATCH] More correct code for \humhub\modules\file\widgets\Upload::init() --- .../humhub/modules/file/widgets/Upload.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/protected/humhub/modules/file/widgets/Upload.php b/protected/humhub/modules/file/widgets/Upload.php index 58518b8570..4e7c2bf9fa 100644 --- a/protected/humhub/modules/file/widgets/Upload.php +++ b/protected/humhub/modules/file/widgets/Upload.php @@ -1,9 +1,9 @@ id) { + if (!$this->id) { $this->id = $this->getId(true); } - if($this->max === true) { - $this->max = Yii::$app->getModule('content')->maxAttachedFiles; + if ($this->max === true) { + /** @var \humhub\modules\content\Module $contentModule */ + $contentModule = Yii::$app->getModule('content'); + if ($contentModule !== null) { + $this->max = $contentModule->maxAttachedFiles; + } } }