From 6b59c40bac077986bf7bbbc490b22604f2de72ed Mon Sep 17 00:00:00 2001 From: DariusIII Date: Thu, 11 Jan 2018 12:38:15 +0100 Subject: [PATCH] Update headermenu.tpl and Category model --- Changelog | 1 + app/Models/Category.php | 4 ++-- public/themes/Charisma/headermenu.tpl | 2 +- public/themes/Gamma/headermenu.tpl | 2 +- public/themes/Gentele/headermenu.tpl | 2 +- public/themes/Omicron/headermenu.tpl | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Changelog b/Changelog index f5efa0da2..406a2c5c4 100755 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ 2018-01-11 DariusIII + * CHg: Update headermenu.tpl and Category model * Chg: Update Releases and Genres classes * Chg: Update Categorize and Regexes classes * Chg: Remove nntmux/Category class and move its functions into Category model diff --git a/app/Models/Category.php b/app/Models/Category.php index 7675637d5..bbba4f2b0 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -439,13 +439,13 @@ class Category extends Model if ($arrsql !== null) { $arr = $arrsql; } else { - $arr = $sql->get(); + $arr = $sql->get()->toArray(); $expiresAt = Carbon::now()->addSeconds(NN_CACHE_EXPIRY_LONG); Cache::put(md5(implode(',', $excludedCats).implode(',', $roleExcludedCats)), $arr, $expiresAt); } foreach ($arr as $key => $val) { - if ($val['id'] === '0') { + if ($val['id'] === self::OTHER_ROOT) { $item = $arr[$key]; unset($arr[$key]); $arr[] = $item; diff --git a/public/themes/Charisma/headermenu.tpl b/public/themes/Charisma/headermenu.tpl index 7b8aaf799..e415d02de 100755 --- a/public/themes/Charisma/headermenu.tpl +++ b/public/themes/Charisma/headermenu.tpl @@ -180,7 +180,7 @@ {/if} - {if $parentcat.id === "0"} + {if $parentcat.id == {$catClass::OTHER_ROOT}} {/if} - {if $parentcat.id === "0"} + {if $parentcat.id == {$catClass::OTHER_ROOT}} {/if} - {if $parentcat.id === "0"} + {if $parentcat.id == {$catClass::OTHER_ROOT}} {/if} - {if $parentcat.id === "0"} + {if $parentcat.id == {$catClass::OTHER_ROOT}}