From a1ff35f6ce132114929448bb4ea4beb34ea7b3ad Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 20 Jun 2024 14:47:46 +0100 Subject: [PATCH 1/2] Possible fix for #14915 Signed-off-by: snipe --- app/Importer/AssetImporter.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index 6b3f2f1d008c..96a4d0c9b264 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -20,7 +20,9 @@ public function __construct($filename) { parent::__construct($filename); - if (!is_null(Statuslabel::first())) { + $this->defaultStatusLabelId = Statuslabel::first(); + + if (!is_null(Statuslabel::deployable()->first())) { $this->defaultStatusLabelId = Statuslabel::deployable()->first()->id; } } From 45dbe5cb77a6a2ab2cce603d50d083a3e71b4c8a Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 20 Jun 2024 15:05:38 +0100 Subject: [PATCH 2/2] Return the id, not the entire status label Signed-off-by: snipe --- app/Importer/AssetImporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Importer/AssetImporter.php b/app/Importer/AssetImporter.php index 96a4d0c9b264..02ffa2077c86 100644 --- a/app/Importer/AssetImporter.php +++ b/app/Importer/AssetImporter.php @@ -20,7 +20,7 @@ public function __construct($filename) { parent::__construct($filename); - $this->defaultStatusLabelId = Statuslabel::first(); + $this->defaultStatusLabelId = Statuslabel::first()->id; if (!is_null(Statuslabel::deployable()->first())) { $this->defaultStatusLabelId = Statuslabel::deployable()->first()->id;