fixes inconsistencies with generating labels

This commit is contained in:
Godfrey M 2024-03-04 10:26:38 -08:00
parent 9419c7fdeb
commit e926db76a0

View file

@ -38,7 +38,7 @@ class Label implements View
$settings = $this->data->get('settings'); $settings = $this->data->get('settings');
$assets = $this->data->get('assets'); $assets = $this->data->get('assets');
$offset = $this->data->get('offset'); $offset = $this->data->get('offset');
$template = $this->data->get('template'); $template = LabelModel::find($settings->label2_template);
// If disabled, pass to legacy view // If disabled, pass to legacy view
if ((!$settings->label2_enable) && (!$template)) { if ((!$settings->label2_enable) && (!$template)) {
@ -49,13 +49,6 @@ class Label implements View
->with('count', $this->data->get('count')); ->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(); $template->validate();
$pdf = new TCPDF( $pdf = new TCPDF(