Merge pull request #14924 from snipe/fixes/possible_nicer_handling_for_defaultStatusLabel

Possible fix for #14915 - error on import when status label is not provided and no deployable statuses can be found
This commit is contained in:
snipe 2024-06-21 21:37:22 +01:00 committed by GitHub
commit 665aa6eb23
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -20,7 +20,9 @@ class AssetImporter extends ItemImporter
{ {
parent::__construct($filename); parent::__construct($filename);
if (!is_null(Statuslabel::first())) { $this->defaultStatusLabelId = Statuslabel::first()->id;
if (!is_null(Statuslabel::deployable()->first())) {
$this->defaultStatusLabelId = Statuslabel::deployable()->first()->id; $this->defaultStatusLabelId = Statuslabel::deployable()->first()->id;
} }
} }