ryanhowdy / fcms

Family Connections - Create a private family website.
http://www.familycms.com
GNU General Public License v2.0
84 stars 41 forks source link

Add support for default avatar when using protected photos #498

Closed colml closed 9 years ago

colml commented 9 years ago

When using the protected photos feature the default avatar image links are not always correct as the link is hard-coded to the old location (URL_PREFIX.'uploads/avatar/no_avatar.jpg) in most cases.

This PR updates the getAvatarPath() function and changes the hard-coded URLs to call that function instead.

ryanhowdy commented 9 years ago

I can't figure out why these changes are necessary. It's been a while since I wrote that code, but the Profile Destination class should handle this logic without the need for these changes.

Instead of updating the default Profile Destination class, I'd rather figure out why the Protected Profile Destination class isn't called. Which is what is supposed to happen.

colml commented 9 years ago

That's a good point, I hadn't looked close enough at the Protected Profile Destination class earlier. It looks like the Protected Profile Destination class is being called correctly in the getAvatarPath() function, however there are a few places where the no_avatar.jpg URL is hardcoded which bypasses the getAvatarPath() call to the Protected Profile Destination class.

Instead of the patch I submitted here is an alternative that should work:

If you think this is a better solution and you would like me to submit a pull request for it let me know.

ryanhowdy commented 9 years ago

That all sounds perfect.

And yes, you can definitely submit another pull request, that would be a big help.