Merge pull request #14362 from Godmartinz/labels-not-generating-properly

Fixes inconsistencies with generating labels
This commit is contained in:
snipe 2024-03-04 18:49:44 +00:00 committed by GitHub
commit 9a5c1b8126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -38,7 +38,7 @@ class Label implements View
$settings = $this->data->get('settings');
$assets = $this->data->get('assets');
$offset = $this->data->get('offset');
$template = $this->data->get('template');
$template = LabelModel::find($settings->label2_template);
// If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) {
@ -49,13 +49,6 @@ class Label implements View
->with('count', $this->data->get('count'));
}
// If a specific template was set, use it, otherwise fall back to default
if (empty($template)) {
$template = LabelModel::find($settings->label2_template);
} elseif (is_string($template)) {
$template = LabelModel::find($template);
}
$template->validate();
$pdf = new TCPDF(