From 8bddea2ca9c8c3c36aff36eb1a715dcd54b94514 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 24 Apr 2018 11:00:02 -0700 Subject: [PATCH] Fixed #2798 --- CHANGELOG-v3.md | 1 + src/elements/Asset.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-v3.md b/CHANGELOG-v3.md index f4582471251..5e8d880a4f1 100644 --- a/CHANGELOG-v3.md +++ b/CHANGELOG-v3.md @@ -25,6 +25,7 @@ - Fixed a bug where elements within relational fields could have two thumbnails. ([#2785](https://github.com/craftcms/cms/issues/2785)) - Fixed a bug where it was not possible to pass a `--table-prefix` argument to the `setup/db-creds` command. ([#2791](https://github.com/craftcms/cms/pull/2791)) - Fixed an error that occurred for users without permission to perform updates, if available update info wasn’t cached. +- Fixed an error that occurred when `craft\elements\Asset::sources()` was called in a console request. ([#2798](https://github.com/craftcms/cms/issues/2798)) ## 3.0.3.1 - 2018-04-18 diff --git a/src/elements/Asset.php b/src/elements/Asset.php index d1fc44c018b..378e282e7d5 100644 --- a/src/elements/Asset.php +++ b/src/elements/Asset.php @@ -184,7 +184,7 @@ protected static function defineSources(string $context = null): array $sourceList = self::_assembleSourceList($tree, $context !== 'settings'); // Add the customized temporary upload source - if ($context !== 'settings') { + if ($context !== 'settings' && !Craft::$app->getRequest()->getIsConsoleRequest()) { $temporaryUploadFolder = Craft::$app->getAssets()->getCurrentUserTemporaryUploadFolder(); $temporaryUploadFolder->name = Craft::t('app', 'Temporary Uploads'); $sourceList[] = self::_assembleSourceInfoForFolder($temporaryUploadFolder, false);