Topic-icon Import of avatar is fine, but cover is not being imported

Active Subscriptions:

None
I'm using EasySocial and I do have the correct Social Profiles plugin enabled. The fact is that avatars are being imported, but not covers.

What else should I be checking? Is this a JFBConnect issue or an EasySocial issue?
The topic has been locked.
Support Specialist
We definitely test with the cover photo and know it should work in EasySocial v1.0.5 - v1.0.8 (the latest).

Can you test with multiple networks and let me know how that goes? You don't mention specifically above which one isn't working, so not sure if it's not working for just Facebook (for instance). We support cover import for Facebook, Google+ and Twitter, by the way.

Finally, can you let me know if you've altered the profile fields for the user type you're using? That shouldn't matter, but there's a lot of logic in our code to determine the cover photo for a specific user type.. so if you altered that, it could help narrow down where something is going wrong.

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

None
12 years 6 months ago #39216 by haibar
After fixing our other problems (php, xml, etc), things related to JFBConnect now seem to be pretty smooth. However, for FB and G+, we're not importing the cover on account creation. Why not and where would I look for issues? The avatar is still imported just fine. (our images for EasySocial are on S3).
The topic has been locked.
Support Specialist
I just looked at the code and see a stupid mistake we made. My guess is that your temp directory for your Joomla site is not <Joomla Site>/tmp

If not, please edit the /libraries/sourcecoast/plugins/socialprofiles.php file. In there, there are 3 instances where we call:
JPATH_SITE . '/tmp/'
Update each of those to:
$this->getAvatarPath()

For instance, the first one (at line 522) looks like:
JFile::write(JPATH_SITE . '/tmp/' . $tmpImgName, $data);
Update that to:
JFile::write($this->getAvatarPath() . $tmpImgName, $data);

Let me know how that goes, and thanks for pointing that out!
Alex
The topic has been locked.
Active Subscriptions:

None
12 years 6 months ago - 12 years 6 months ago #39236 by haibar
I made the changes, but that didn't help (anyway, my temp directory was /tmp under the Joomla root).

I did one other change that might help. We have Admin Tools and it made it difficult at times to upload images for EasyBlog in the frontend (media manager) always getting an HTTP error. We've adjusted the WAF and perhaps this will help with EasyBlog AND the cover import for JFBConnect. We'll see...
Last edit: 12 years 6 months ago by haibar.
The topic has been locked.
Support Specialist
Hmmm.. can you check your temp directory for files with the following type of name:
sccover_facebook123_pic_tmp.jpg
Where facebook could be facebook, google or twitter and 123 is the user's social network ID.

That will help narrow down where things are going south. We haven't heard of this issue from anyone else, but we'll gladly help investigate however we can.

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

None
12 years 6 months ago #39297 by haibar
I do see profile pics (I assume these are imported avatars) such as scprofile_5200_pic_tmp.jpg, however, I don't see a single cover photo. So we are pointing to the correct temp directory, it is writable and avatars (from FB, G+ and TW) are just fine... but not covers.

Futher suggestions?
The topic has been locked.
Support Specialist
Hmm.. we are investigating, and I see one problem with my code above. However, since you're using the standard tmp path, the original code should have worked.

Can you update the cover photo saving line to:
JFile::write($this->getAvatarPath() . '/' . $tmpImgName, $data);
That extra / is definitely important.. but again, the original code should have worked as well.

Beyond that, please double check the settings in the Profiles area:
* Import Cover - Yes (obviously)
* Always Import Profile - Yes (if testing when a user is re-logging in. If 'no', cover will only be imported on registration)

Sorry to go in a few circles here. Let me know if the files properly show up in the directory, but aren't saving (or hopefully are working perfectly), and we'll go from there. The next step would be for us to get into the site to diagnose where things are failing.

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

None
12 years 6 months ago #39306 by haibar
Yes and no. You needed not only the change on the line you told me, but also on the one below that. The two lines should now be:
        JFile::write($this->getAvatarPath() . '/' . $tmpImgName, $data);
        $cover->set('path', $this->getAvatarPath() . '/' . $tmpImgName);
and now that works. Thanks. Please tell me that this will be in the next version so I don't have to worry about any patches. Thanks.
The topic has been locked.
Support Specialist
Absolutely. We've already checked that code into our repository, and it will be in the v5.2.2 release, planned for next week. There actually were 3 places where the change needed to be made in that file. The 2 you found, and then another a few lines below:
if (!imagejpeg($image_p, $this->getAvatarPath() . '/' . $tmpImgName, 100))
Feel free to make that change in the last line just to make sure it doesn't behave differently, since all 3 updates will be in the next release.

The v5.2.2 release will also fix the session issue... by the way, have you implemented the minor change I recommended for that to disable the session check? Just curious.

Thanks,
Alex
The topic has been locked.