Fixes #371 Tagged items when pinning/unpinning (#1036)

This commit is contained in:
KodeStar
2022-11-25 23:21:45 +00:00
committed by GitHub
parent 7565bd4028
commit aa49a5fb42
2 changed files with 34 additions and 25 deletions

View File

@@ -106,12 +106,20 @@ class ItemController extends Controller
$item->pinned = $new;
$item->save();
if ($ajax) {
if (is_numeric($tag) && $tag > 0) {
$item = Item::whereId($tag)->first();
$data['apps'] = $item->children()->pinned()->orderBy('order', 'asc')->get();
} else {
$data['apps'] = Item::pinned()->orderBy('order', 'asc')->get();
$data['apps'] = new \Illuminate\Database\Eloquent\Collection;
if ((int)$tag === 0) {
$tags = Item::where('type', 1)->pinned()->orderBy('order', 'asc')->get();
$data['apps'] = $data['apps']->merge($tags);
}
$apps = $item->children()->pinned()->orderBy('order', 'asc')->get();
$data['apps'] = $data['apps']->merge($apps);
$data['ajax'] = true;
return view('sortable', $data);
@@ -410,7 +418,8 @@ class ItemController extends Controller
$app = $single->class;
// If password is not resubmitted fill it from the database when in edit mode
if (array_key_exists('password', $data) &&
if (
array_key_exists('password', $data) &&
$data['password'] === null &&
array_key_exists('id', $data)
) {

View File

@@ -14,7 +14,7 @@ return [
*/
'name' => env('APP_NAME', 'Heimdall'),
'version' => '2.5.2',
'version' => '2.5.3',
/*
|--------------------------------------------------------------------------