Closed chack1172 closed 6 years ago
Hi, what are the URLs of the pages? I thought there was only meant to be one user page, with different content depending on what profile fields are filled out.
On 26 Jun 2016, at 23:07, chack1172 notifications@github.com wrote:
I'm trying to fix some issues of the repositories. I fixed user page but I have 2 alternatives. Which one you are going to use?
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.
euantorano the url is only one: mysite.com/public/index.php/user/1/Admin
So the correct page is the second image?
Yes, the second one looks right to me. The two are similar, the only difference is that empty fields are hidden in the second image.
There are some issues with the styling though. The registration date should all be on one line, same with visit date. Paging @justinsoltesz!
Ok, I have another questions. If I go to Admin profile I see the two profile fields because I set them in the database. If I go to another user (e.g. Registered) I see the two fields empty, why they aren't hidden?
They should be hidden, there's obviously something missing in the query. This method probably needs to exclude NULL
profile fields: https://github.com/mybb/mybb2/blob/master/app/Database/Repositories/Eloquent/ProfileFieldRepository.php#L66
I'll have a look tonight after work.
euantorano I only changed function hasForProfileField() in app/Database/Repositories/Eloquent/ because $user is not passes/empty/null.
public function hasForProfileField(User $user=NULL, ProfileField $profileField)
{
if($user === NULL)
return $this->userProfileField->where('profile_field_id', $profileField->id)
->count() > 0;
else
return $this->userProfileField->where('user_id', $user->getId())
->where('profile_field_id', $profileField->id)
->count() > 0;
}
Yep, that would also do it. $user
is null for guests (which will be changed soon).
Why is it null for guests? It shouldn't contain user data we are looking at?
Oops, it shouldn't be null actually. I was thinking $user
was the currently logged in user. It should never be null for that method. if it is, there's another problem somewhere.
I'm still at work right now so it's difficult for me to debug until I get home unfortunately.
I'm trying to fix some issues of the repositories. I fixed user page but I have 2 alternatives. Which one you are going to use?