From 4d19dbf58d0a3d9f8a2dd3eaf0e5867ccff7860d Mon Sep 17 00:00:00 2001 From: DariusIII Date: Tue, 17 Oct 2017 01:45:52 +0200 Subject: [PATCH] Wrong model used in getRoleCategoryExclusion function --- Changelog | 2 ++ app/Models/RoleExcludedCategory.php | 4 +++- nntmux/Users.php | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index 92ecb2f3b..b6dd24b31 100755 --- a/Changelog +++ b/Changelog @@ -1,3 +1,5 @@ +2017-10-17 DariusIII + * Fix: Wrong model used in getRoleCategoryExclusion function 2017-10-16 DariusIII * Chg: Update laravel/framework and phpunit to latest versions * Fix: Fix path to jquery-goup in Gentele theme diff --git a/app/Models/RoleExcludedCategory.php b/app/Models/RoleExcludedCategory.php index 0e9a40bf8..bc66b03d1 100644 --- a/app/Models/RoleExcludedCategory.php +++ b/app/Models/RoleExcludedCategory.php @@ -6,5 +6,7 @@ use Illuminate\Database\Eloquent\Model; class RoleExcludedCategory extends Model { - // + protected $dateFormat = false; + + protected $guarded = []; } diff --git a/nntmux/Users.php b/nntmux/Users.php index a1c01f230..a29a94d32 100755 --- a/nntmux/Users.php +++ b/nntmux/Users.php @@ -2,6 +2,7 @@ namespace nntmux; +use App\Models\RoleExcludedCategory; use nntmux\db\DB; use Carbon\Carbon; use App\Models\User; @@ -1001,7 +1002,7 @@ class Users public function getRoleCategoryExclusion($role): array { $ret = []; - $categories = UserExcludedCategory::query()->where('role', $role)->get(['categories_id']); + $categories = RoleExcludedCategory::query()->where('role', $role)->get(['categories_id']); foreach ($categories as $category) { $ret[] = $category['categories_id']; }