From 97a08f8094a8c389253576228c0ff86eae283de7 Mon Sep 17 00:00:00 2001 From: brandonkelly Date: Tue, 23 Jan 2024 04:48:13 -0800 Subject: [PATCH] =?UTF-8?q?Stop=20including=20the=20temp=20volume=20in=20?= =?UTF-8?q?=E2=80=9Call=20sources=E2=80=9D=20for=20Assets=20fields?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/fields/Assets.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/fields/Assets.php b/src/fields/Assets.php index ece9d049756..27edd749304 100644 --- a/src/fields/Assets.php +++ b/src/fields/Assets.php @@ -715,8 +715,14 @@ public function getInputSources(?ElementInterface $element = null): array|string $sources = array_merge($this->sources); } else { $sources = []; + [$tempVolume] = Craft::$app->getAssets()->getTempVolumeAndSubpath(); + $tempVolumeKey = $tempVolume ? "volume:$tempVolume->uid" : null; + foreach (Craft::$app->getElementSources()->getSources(Asset::class) as $source) { - if ($source['type'] !== ElementSources::TYPE_HEADING) { + if ( + $source['type'] !== ElementSources::TYPE_HEADING && + $source['key'] !== $tempVolumeKey + ) { $sources[] = $source['key']; } }