Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Viewing profiles as Guest #206

Open
Hackmastr opened this issue Apr 10, 2016 · 3 comments
Open

Viewing profiles as Guest #206

Hackmastr opened this issue Apr 10, 2016 · 3 comments

Comments

@Hackmastr
Copy link

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.

@euantorano
Copy link
Member

Again, looks like a lack of permission checking.

@JoshHarmon
Copy link
Contributor

JoshHarmon commented Jun 16, 2016

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());

@euantorano
Copy link
Member

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.

@JordanMussi JordanMussi changed the title [Bug] Viewing profiles as Guest Viewing profiles as Guest Sep 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants