Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/View/Label.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ public function render(callable $callback = null)
$assets = $this->data->get('assets');
$offset = $this->data->get('offset');

// if you're printing location target tags, make sure the assets have locations if not redirect with error
if (($settings->label2_2d_target == 'location')) {
foreach ($assets as $asset) {
if (!$asset->location_id) {
return redirect()->back()->with('error', trans('admin/labels/message.asset_no_location'));
}
}
}


// If disabled, pass to legacy view
if ((!$settings->label2_enable)) {
Expand Down
2 changes: 2 additions & 0 deletions resources/lang/en-US/admin/labels/message.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
'invalid_return_type' => 'Invalid type returned from :name. Expected :expected, got :actual.',
'invalid_return_value' => 'Invalid value returned from :name. Expected :expected, got :actual.',

'asset_no_location' => 'You have selected to target your labels to locations, and one or more of the assets\' tags you\'re trying to print do not have a location.',

'does_not_exist' => 'Label does not exist',

];
Loading