Hello ,
after upgrade for latest version , il have a 404 not found for non logged in user in home page of jomsocial .
i think the bug is in this function :
public function showLatestActivities() {
$config = CFactory::getConfig();
$my = CFactory::getUser();
$session = JFactory::getSession();
$jinput = JFactory::getApplication()->input;
/* We do store filters into session than we can reuse it under ajax */
$filter = $jinput->get('filter', $config->get('frontpageactivitydefault'));
$value = $jinput->get('value');
if (strpos($filter, ':') !== false && !$my->guest) {
$filter = explode(':', $filter);
JFactory::getApplication()->redirect(CRoute::_('index.php?option=com_community&view=frontpage&filter=' . $filter[0] . '&value=' . $filter[1]));
}
$userActivities = '';
/* Filtering */
switch ($filter) {
/* Filter by privacy */
case 'privacy':
/* Filter by me and my friends */
if ($value == 'me-and-friends' && $my->id != 0) {
/**
*
* @param type $filter
* @param type $userId
* @param type $view
* @param type $showMore
*/
$userActivities = CActivities::getActivitiesByFilter('active-user-and-friends', $my->id, 'frontpage', true);
} else {
/* No filter. Get all */
$userActivities = CActivities::getActivitiesByFilter('all', $my->id, 'frontpage', true);
}
break;
/* Filter by type */
case 'apps':
/* By default we use all */
$userActivities = CActivities::getActivitiesByFilter('all', $my->id, 'frontpage', true, array('apps' => array($value)));
break;
/* By default we do filter by privacy and follow backend configured */
default:
$defaultFilter = $config->get('frontpageactivitydefault');
/* Filter by me and my friends and of course not for guess */
if ($defaultFilter == 'friends' && $my->id != 0) {
$userActivities = CActivities::getActivitiesByFilter('active-user-and-friends', $my->id, 'frontpage', true);
} else {
$userActivities = CActivities::getActivitiesByFilter('all', $my->id, 'frontpage', true);
}
break;
}
$activities = array();
$activities = $userActivities;
return $activities;
}
thanks .
Hi, Marc.
Are you referring to upgrade to JomSocial 3.2 RC1?
I migrated to version 3.1 and then to the 3.2rc , the bug is the same .
Hi, Marc.
JS 3.2 RC1 is not for production sites... it's only for testing.
You posted in wrong category, I'll change it and assign other support member to this thread.
I reinstall the version 3.1 , and the bug still .
thanks for help .
Hi, Marc.
You say that it worked before upgrade?
As for me you had messed up menu. You have few (I saw at least two) menu items for the same page (JomSocial frontpage)
Also remember: if you want to create a second menu item to JomSocial page that alread has a meni item in JomSocial toolbar -> use menu alias instead linking directly!
Please, try to disable all duplicated JomSocial menu items and leave only one frontpage item for JomSocial.
Hi ,
i disable all duplicated JomSocial menu items and leave only one frontpage item for JomSocial but it bug
the menu item work fine when the user logged in .
thanks for help
Hi, Marc.
Hmm. Tel me why you think that there is error in code you posted ?
Did you use customized htaccess?
Hi
because if a delete content of this function i dont have the 404 not found .
the htaccess is not modified .
thanks for help :)
Hi, Marc.
Please make safe copy of your site - I tried do it in Akeeba backup but I encounter error.
Also please check FTp credentials you provided us - I can't connect via FTP.
I made the backup and the ftp is work , thanks for help
Hi, Marc.
I confirm that FTP works.
Could you tell where file with code you pasted in your first post is located?
I searched package of JomSocial 3.1.1 and I was unable to locate whole code... it seem that it's combined from different files.
hy
the file is located in
/components/com_community/views/frontpage/view.html.php
line 128
thanks for help .
the code is , it work for logged in user , but not for guest :
public function showLatestActivities() {
$act = new CActivityStream();
$config = CFactory::getConfig();
$my = CFactory::getUser();
$userActivities = '';
if ($config->get('frontpageactivitydefault') == 'friends' && $my->id != 0) {
$userActivities = CActivities::getActivitiesByFilter('active-user-and-friends', $my->id, 'frontpage', true);
} else {
$userActivities = CActivities::getActivitiesByFilter('all', $my->id, 'frontpage', true);
}
$activities = array();
$activities = $userActivities;
return $activities;
}