Topic-icon Google+ Login Profile Picture is not working

Active Subscriptions:

None
10 years 2 weeks ago #43199 by y021ahe
Alex, I have done a number of tests and I have included a number of screen prints.

The fundamental testing process is the same

i) Deleted entries from JFBConnect Usermap
ii) Deleted entries from Kunena User manager and Joomla
iii) Logged in with Facebook from SC Login (4.0.4) .... "new login through Facebook.JPG"
iv) Checked Kunena User Manager - Icon shown as Facebook picture .... "Kunena User Manager.JPG" / "Joomla User login.JPG"
v) Checked JFBConnect User Map - Icon shown as Facebook picture . "Logged in with Google+ - JFBConnect User Map.JPG"

Google has no icon (photo), then performed the following... see zip file below.

vi) Logged in with Google+ - No icon photo set in Google...... "Logged in with Google+ - No icon in Google - Profile.JPG" / "Logged in with Google+ - No icon in Google.JPG"
vii) Checked Kunena User Manager - Icon shown as Facebook picture ... "Logged in with Google+ - Kunena User Manager.JPG"
viii) Checked JFBConnect User Map - ICON ** BROKEN ** Nothing showing ---- *** BUG IN 6.0.4 I believe *** "Logged in with Google+ - JFBConnect User Map.JPG"

Zip-file-showing-screen-prints---Initial-checks-and-Logins-with-no-Icon-set-in-Google.zip

Next Added an icon photo to the Google Profile and tried again - points i)-iii) above continued as before. .. See Zip File below.....

ix) Logged in with Google+ - ...... "Logged in with Google+.JPG"
x) Checked Kunena User Manager - Icon shown as Facebook picture ... "Logged in with Google+ - Kunena User Manager.JPG"
xi) Checked JFBConnect User Map - ICON ** BROKEN ** Nothing showing ---- *** BUG IN 6.0.4 I believe *** "Logged in with Google+ - JFBConnect User Map.JPG"

Screen-Prints-after-icon-added-in-Google.zip

Hope this helps to ascertain what the problem is.

Rich
The topic has been locked.
Active Subscriptions:

None
10 years 1 week ago #43394 by y021ahe
Hi,
Has anyone been able to review this topic update please?

Rich
The topic has been locked.
Support Specialist
10 years 6 days ago #43530 by alzander
Alright, we've gone through your pictures, distilled what you've said, and done extensive testing. This is taking a while, but it's a complex, nuanced issue that we are looking at. The issues you present above ultimately boil down to 2 specific issues:
1) If a user logs in using Google and has no avatar image set in Google, their existing Kunena avatar is removed. Normally, if the user has a Google+ avatar, their Kunena avatar would be updated.
** Bottom line: JFBConnect should be detecting if the Google image isn't set (is the default) and not update the Kunena avatar in this case.
2) The usermap area isn't showing a Google+ avatar under any circumstance.
#1) Please try the following code change. Edit the /components/com_jfbconnect/libraries/profile/google.php file. Around line 209, you'll see:
$profile = $this->fetchProfile($providerUserId, 'image');
        $avatarUrl = $profile->get('image.url', null);
Update that with the new lines shown below:
$profile = $this->fetchProfile($providerUserId, 'image');
        $avatarUrl = $profile->get('image.url', null);
        // Check for default image
        $http = new JHttp();
        $avatar = $http->get($avatarUrl);
        if ($nullForDefault && $avatar->code == 200 && $avatar->headers['Content-Length'] == 946)
            return null;
That should properly detect that the G+ image is the 'default' image and not overwrite the Kunena avatar with that image. However, there's another issue I can see with JFBConnect where, if you're configuration is to "Update Profile Always", that we'll instruct Kunena to revert the user's avatar back to the default Kunena value. This will be a different shadow icon. Fixing this should be relatively simple. I'd like to get your input on if the code above fixes the main issue you're having on the front-end though first.

For #2, that's a more difficult fix as there's issues with Google and what they require to fetch a user's profile. Simply put, in the admin area, you're not logged in with a Google account, so there's no authentication token to be used. Because of this, we can't retrieve the user's avatar. We're looking into a possible way around this, but I don't have a fix right now for you. It also shouldn't cause any functional issues as the user exists, you just can't see their avatar image in the admin area. You can click the red G+ link/image to visit their profile though.

Please let me know how that goes. Knowing that the avatar was blank in Google+ was key to understanding and investigating further.

Thanks for your patience, and I hope this gets you moving forward!

Alex
The topic has been locked.
Active Subscriptions:

None
10 years 6 days ago #43544 by y021ahe
Alex,
I have tested #1). Now it doesnt show the facebook icon anywhere when I log in with Google+

Please see the attached word doc, with a number of screen shots for your review.

Google-JFBConnect-test.doc

Please let me know the next steps

Rich
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #43842 by y021ahe
Hi
Do you have any updates on the progress of this issue please?

Rich
The topic has been locked.
Support Specialist
9 years 11 months ago #43864 by alzander
Ughhh. First, I know you've already renewed your subscription, which will start in a few days. I wanted to let you know that I've gone ahead and extended that renewal by an additional 3 months. I do apologize, again, for the delays in this, and I hope that helps. In May, both LinkedIn and Facebook have made big updates to their systems, which has distracted us much more than we'd have liked.

As to your issue above, I'm glad we're making progress. The simple change below should prevent Kunena from reverting back to the default 'shadow' avatar whenever a user logs in using an account that doesn't have any avatar set. Please edit the /libraries/sourcecoast/plugins/socialprofile.php file. Around line 481, you'll see:
if ($avatarURL == null)
        {
                $this->setDefaultAvatar($this->joomlaId);
            return false;
        }
Update that with an extra 'if' statement, as shown below:
if ($avatarURL == null)
        {
            if ($this->registrationUser) // Only revert to the default avatar if new user registration
                $this->setDefaultAvatar($this->joomlaId);
            return false;
        }
Please let me know how that goes.

The profile plugins are due for an overhaul, expected in the 6.2 release. In that release, we're planning on breaking out each setting to "On Register", "On Login" or "Both", so that you have more control over when avatars are imported vs profile data vs other information. We're planning to add both of the code changes above to the 6.1 release, planned for early June. Until then, if you upgrade to any minor releases (6.0.6, which will be out later today), you'll need to make these changes again.

I hope that helps get you going, but please let us know if you still have issues.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #43915 by y021ahe
Alex,
Ive installed version 6.0.6 to test with ("JFBConnect 6.0.6 - Code change.JPG"). I've added the code as you advised. The test process is written below and the results are enclosed as screen prints in the attached zip file.

I think the only issue I have (which i think is consistent) is that if you log in with the Google+ account with no profile picture, having previously had a profile created with a profile picture (Facebook/Kunena) , then it blanks out / overrides the profile picture and shows the empty google one.
** Because this case is going on a bit, i'm losing the plot as to whether this is expected and we can't do anything about it. - Realistically we just want that if there is no profile picture in Google+, it use the Facebook / Kunena picture if its there.

i) Deleted entries from JFBConnect Usermap
ii) Deleted entries from Kunena User manager and Joomla
iii) Logged in with Facebook from SC Login (4.0.6) .... "Facebook Login&Registration.JPG"
iv) Logged in and Profile picture in Kunena Front End ... "Facebook Profile Picture.JPG"
v) Checked JFBConnect User Map - Icon shown as Facebook picture . "JFBConnect User Map Picture.JPG"
vi) Checked Kunena User Manager - Icon shown as Facebook picture .... "Kunena User Manager Picture.JPG"

Google has no icon (photo), then performed actions i) and ii) above then the following...

vii) Logged in with Google+ - No icon photo set in Google...... "Google+ Login.JPG" / "Google+ Login override Kunena Forum.JPG"
viii) Checked Kunena User Manager - Icon shown as Facebook picture ... "Kunena User Manager after Google+ login.JPG"
ix) Checked JFBConnect User Map - "JFBConnect User Map after Google+ login.JPG"

Next Added an icon photo to the Google Profile and DID NOT perform actions i) and ii) above then the following....

x) Logged in with Google+ - ...... "Google+ Login after picture added to Google.JPG"
xi) Checked Kunena User Manager - Icon shown as Facebook picture ... "Google+ Login in Kunena User manager after picture added to Google.JPG"
xii) Checked JFBConnect User Map - "JFBConnect User Map after Google+ login and Picture added.JPG"
xiii) I then checked the profile picture in the Kunena Login Module (not sclogin) which showed "Google+ Picture in Kuena Login box after picture added to Google.JPG"

Next with the photo still added to the Google Profile, I then performed actions i) and ii) above then the following....

xiv) Logged in with Google+ - ...... "Registered with Google+ after deleting User.JPG" / "Google+ Login - Profile.JPG"
xv) Checked Kunena User Manager - Icon shown as Google+ picture ... "Kunena User Manager with Google+ after deleting User.JPG"
xvi) Checked JFBConnect User Map - No pic as expected - "JFBConnect User Map with Google+ after deleting User.JPG"
xvii) I then relogged in with Facebook - "Relogging in with Facebook - shows facebook picture.JPG"
xviii) Checked JFBConnect User Map - "JFBConnect User Map - Relogging in with Facebook shows facebook picture.JPG"
xix) Checked Kunena User Manager - "Kunena User Manager - Relogging in with Facebook - shows google+ picture.JPG"
xx) In the Kunena module interstingly it shows the Facebook picture - "IN KUNENA LOGIN MODULE - Relogging in with Facebook shows google picture"

Google-Testing.zip

Could you please confirm that you have received the update and the images ok, or whether you need anything else?

Rich

BTW - Thankyou for extending the subscription - that was very kind and not at all expected. I am more than happy to help or Beta test for you if you would like.
The topic has been locked.
Support Specialist
9 years 11 months ago #43944 by alzander
You noted that you made one code change from above. Did you make the code change in this post from above as well?

Basically, to answer your question, *yes* you should be able to login with a Google+ user and *if* that user has no avatar your existing avatar will *not* be overwritten. However, that's not the current functionality of JFBConnect, though will be in an upcoming release. To achieve that functionality, you should need to implement both code snippets above:
* This one implements the proper check to determine if Google+ is returning the 'blank' default avatar. This prevents the 'blue silhouette' which Google tries to return from being used as the user's avatar.
* This change , which it looks like you've already implemented. This will check to see if the default avatar was returned from Google. If so and the user is registering for the first time, we'll instruct Kunena to set the default avatar from Kunena for that user. If the user is simply logging back in again, we don't tell Kunena to do anything... which should leave the user's current avatar intact.

I hope that helps explain and really hope that second code change is what you need to get things going.

If you need anything else or continue to have issues, please let me know!

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
9 years 11 months ago #43960 by y021ahe
Alex,
I apologise for the previous post. I hadn't understood that it needed both code updates, I assumed that the later one overrode the previous the one.

Right I have updated both code entries and have performed my test cycle again. I can confirm that the tests proved that it now works as described. If there is a kunena picture and no google picture, it shows the kunena one if you log in with joomla/facebook/google. If there is a google picture, then it shows the google picture in both the SClogin and Kunena login module. This is what we need.

Are you able to add these simple code corrections into 6.0.7 whenever that comes out, until you have the more permanent strategic changes in place. That will help me and other users and prevent the need that we have to keep remembering to make the changes every time you provide the minor upgrades.

Please let me know how you are planning to proceed.

Thanks

Rich
The topic has been locked.
Support Specialist
9 years 11 months ago #43964 by alzander
Rich,
I'm so happy to hear that things work with both code changes. Both of those updates are already checked into our development area for release in v6.1.0, due out in June. We really, really are hoping there's no need for a JFBConnect v6.0.7 in the meantime, but the social networks we integrate with have been deciding to make sweeping updates lately, necessitating a lot of our point releases. If a 6.0.7 is necessary we *may* add these changes, but likely not. In general, we don't like changing functionality in bug-fix releases because, even if the change is generally 'good', it's not something users expect.

Bottom line, keep an eye on this thread if a v6.0.7 is released. Otherwise, in 6.1.0, you shouldn't have to think about this at all.

Thanks again for your patience and help in your detailed explanations as to what was going wrong. It really helps make JFBConnect a better product in the long-run.

Best of luck,
Alex
The topic has been locked.