mybb2
mybb2 copied to clipboard
Viewing profiles as Guest
An error is thrown:
ErrorException in profile_basic.twig line 6:
An exception has been thrown during the rendering of a template ("Argument 1 passed to
MyBB\Core\Database\Repositories\Eloquent\UserProfileFieldRepository::hasForProfileField() must
be an instance of MyBB\Core\Database\Models\User, null given, called in C:\xampp\htdocs\mybbv2
\app\Presenters\ProfileField.php on line 135 and defined") in "user.profile_basic" at line 6.
If the user logs in, he can view them just fine.
Again, looks like a lack of permission checking.
I think I see what's wrong. We're getting the currently authenticated user (null for guest) from the guard and trying to fetch its profile fields, rather than fetching the profile fields of the relevant user based on URL.
return $this->userProfileFields->hasForProfileField($this->guard->user(), $this->getWrappedObject());
Yes, the past version of the auth package returned a default User for guests. We need to fix the conditions elsewhere to handle the new default case (null).
On 16 Jun 2016, at 21:12, Josh Harmon [email protected] wrote:
I think I see what's wrong. We're getting the currently authenticated user (null for guest) from the guard and trying to fetch its profile field repository.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.