Topic-icon Problem with imported Avatar & Cover albums with EasySocial

Active Subscriptions:

None
12 years 1 month ago - 12 years 1 month ago #43203 by drmadbum
Hi Team,

I am using JFBConnect 6.0.4 with Easy Social 1.2.7 on Joomla 3.2.3

While registering a user account with Facebook account via JFBConnect (on our site), I found a permission problem with the auto-created albums (cover & avatar) in EasySocial.
Let me explain the situation.

JFBConnect Settings
- Enable quick registration via Facebook
- Enable profile import, with Avatar and Cover photo

1) Login and register directly via JFBConnect Facebook connect, with a Facebook account
2) Once it is done, 2 albums (Cover photos & Avatar photos) will be automatically created
3) The account owner can upload any photos into this two albums, by uploading / editing their cover and avatar
... however
4) The account owner is unable to DELETE (guess also for modify) any photos within this "auto created" albums because, the owner of the album is = "A guest" or COM_EASYSOCIAL_GUEST_NAME .

Initially I guess it's JS or JQuery conflict since I got error message from the Chrome' inspector console; Tried with Safari, same problem. Then I tried to login with another locally registered account (no facebook link), I can delete my own photos. After checking from the backend, I guess this is due to permission issue: The album author (owner) is not the account owner him/herself.

Please see the attached PICs FYI. I can only disable this function at the moment. (Auto avatar / cover sync). Please advise any solution to this at the moment or I need to wait for a fix in next release?


File Attachment:


File Attachment:


Thanks.

Best regards,
Alfred / Dreamonde
Last edit: 12 years 1 month ago by drmadbum.
The topic has been locked.
Support Specialist
We're looking into this. For the cover photo, the following change looks like it should get you going (though please test). Please edit the /plugins/socialprofiles/easysocial/easysocial.php file. Around line 618, you'll see:
// Create the default album for this cover.
        $model = Foundry::model('Albums');
        $album = $model->getDefaultAlbum($user->id, SOCIAL_TYPE_USER, SOCIAL_ALBUM_PROFILE_COVERS);
Add the following 2 lines after that:
$album->user_id = $this->joomlaId;
     $album->store();

One other thing to be aware of is that there is a bug in 1.2.7 of EasySocial which can prevent covers from uploading. If you're affected, please see this post with a fix.

For the avatar, in the same file, around line 745, you'll see:
protected function setAvatar($socialAvatar)
    {
Right after that, add the following:
$model = Foundry::model('Albums');
        $album = $model->getDefaultAlbum($this->joomlaId, SOCIAL_TYPE_USER, SOCIAL_ALBUM_PROFILE_PHOTOS);
        $album->user_id = $this->joomlaId;
        $album->store();
Both of those code changes will ensure that the default cover photos are created properly as EasySocial makes some assumptions that don't work with JFBConnect.

Please keep me posted if that gets things going for you. We'll put out a new release soon with these updates, but would love your feedback first.

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

None
Hi Alex,

Much appreciated your prompt response!!

I've testing your suggest codes and confirm both work like a charm !! Great job~

You are safe to include those modification into the next release. Have a nice day.

Best regards,
Alfred / Dreamonde
The topic has been locked.
Support Specialist
Thanks for the feedback on the code update. I'm glad we could get you going. We're evaluating when to push the next release out with this update. If you run into anything else, or have any suggestions or comments in general, just let us know.

Finally, if you haven't already, please consider leaving a rating and review for JFBConnect, or our support, on the Joomla Extension Directory. It certainly isn't required, but is very appreciated:
extensions.joomla.org/extensions/social-...ook-integration/7215

Thanks,
Alex
The topic has been locked.