Notice

The forum is in read only mode.

Support Forum

Welcome! Support Forums have been reactivated
Welcome the Technical Support section. Help us in assisting you by providing us with a concise and descriptive elaboration of your issues. Be specific and if possible, provide us with a step-by-step instruction in replicating your problem.

All Photos Link Points To My Photos For Guests

9 years 6 months ago
  • David's Avatar
    Topic Author
  • David
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 4
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

ISSUE SUMMARY:
When viewing site as guest the menu type Community->All Photos directs users to "My Photos" instead of "All Photos". Also shows guests the "Create Photo Album" link. When a user is logged in the menu type Community->All Photos works properly.


STEPS TO REPLICATE:
1 View JomSocial Demo: demo.jomsocial.com
2 DO NOT log in.
3 As a guest click "Photos"
4
5
RESULT "My Photos" is shown
EXPECTED RESULT "All Photos" or "Photos" should be shown
BROWSER All

9 years 6 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi David,

Thank you for reporting, this is a valid bug.

cheers!

9 years 6 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Hi,

this is the fix if you use 4.1.1
- open this file components/com_community/views/photos/view.html.php
- find this code :

if($task=='myphotos'){
- replace to :
if($task=='myphotos' && $my->id){

cheers!

9 years 6 months ago
  • David's Avatar
    Topic Author
  • David
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 4
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

I made the change that you suggested and the problem is not fixed.

FYI..... all lines in that file that contain "if($task=='myphotos'){" relate to albums.

9 years 6 months ago
  • David's Avatar
    Topic Author
  • David
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 4
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

Actually, I was able to fix it in the template file.

Towards the top of components/com_community/templates/jomsocial/layouts/album/list.php
Change:

    if($type == PHOTOS_GROUP_TYPE){
        $title = JText::_('COM_COMMUNITY_GROUP_PHOTOS');
    }elseif($isOwner){
        $title = JText::_('COM_COMMUNITY_PHOTOS_MY_PHOTOS_TITLE');
    }else{
        $title = JText::_('COM_COMMUNITY_PHOTOS');
    }

TO:
    if($type == PHOTOS_GROUP_TYPE){
        $title = JText::_('COM_COMMUNITY_GROUP_PHOTOS');
    }elseif($isOwner && $my->id){
        $title = JText::_('COM_COMMUNITY_PHOTOS_MY_PHOTOS_TITLE');
    }else{
        $title = JText::_('COM_COMMUNITY_PHOTOS');
    }

The problem is....for some reason $isOwner is being defined as 1 for guests when it should be 0 or null.

9 years 6 months ago
  • David's Avatar
    Topic Author
  • David
  • Offline
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 4
Licenses:
JomSocial Expired iSEO Expired Socialize Expired

The issue is caused by the following statement in components/com_community/views/photos/view.html.php:
$isOwner = ($my->id == $userId) ? true : false;

The problem is $my->id for guests is 0 AND $userId for guests is also 0. Therefore; $isOwner will always be set to true (1) for guests.

The core fix for this is as follows:

In components/com_community/views/photos/view.html.php
Change:

$isOwner = ($my->id == $userId) ? true : false;

To:
if ($userId) {
     $isOwner = ($my->id == $userId) ? true : false;
} else {
     $isOwner = 0;					
}

Either the template fix above or this core fix will remedy the issue. This should be included in the next release of JomSocial.

9 years 6 months ago
  • Dimas's Avatar
  • Dimas
  • Visitor
  • Thank you received: 0
Licenses:

Thank you for your input.. I will report this to our developer..

Moderators: Piotr Garasiński
Powered by Kunena Forum

Join 180,000 websites creating Amazing communities

JomSocial is the most complete, easy-to-use addon that turns Joomla CMS into a
full -fledged, social networking site

TRY NOW BUY NOW