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.

Upgrade joomla 3.6.0 and bug when deleting user

8 years 9 months ago
  • gustavo's Avatar
    Topic Author
  • gustavo
  • Offline
  • Fresh Boarder
  • Posts: 86
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Expired

ISSUE SUMMARY:
hi i updated to joomla 3.6.0 and added the pacth from you guys and its working fine now the jomsocial back end.
but now i have Fatal error: Call to undefined method CommunityModelActivities::removeActivity() in /home/crossupc/redempleo.mx/components/com_community/libraries/activities.php on line 32

STEPS TO REPLICATE:
1 try to delete an user from jomsocial backend
2 try to delete an user from joomla backend
3
4
5
RESULT
EXPECTED RESULT
BROWSER

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

Hi Gustavo,

I tried to replicated on your site
- add new user
- post status on profile page
- delete that new user from backend

and everything is working fine, can you provide me more detail steps to replicate this?

thank you!

8 years 9 months ago
  • gustavo's Avatar
    Topic Author
  • gustavo
  • Offline
  • Fresh Boarder
  • Posts: 86
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi, dimas

It erase it, but it still showing the error then when i go back is erased. I did this in the jomsocial back end monitor / members.

thanks!

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

Hi Gustavo,

Would you mind provide me the screenshoot / video, please?

thank you!

8 years 9 months ago
  • gustavo's Avatar
    Topic Author
  • gustavo
  • Offline
  • Fresh Boarder
  • Posts: 86
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Expired

yes of course.

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

please let me know then :)

8 years 9 months ago
  • gustavo's Avatar
    Topic Author
  • gustavo
  • Offline
  • Fresh Boarder
  • Posts: 86
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Expired






i dont know if you can see the pics?

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

what is the url to access that error ? if that action after delete user, please provide me the video.. because I cant replicate it on your site..

thank you!

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

Hi,

I able to replicate it, but on different why, I am not sure this is related or no with your issue, I already reported this to our developer.

thank you!

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

Hi,

Please you try this fix open this file administrator/components/com_community/models/activities.php, and add this code after line 245 :

/**
             * Remove an activity by ID
             * @param type $activityId
             * @return boolean
             */
            public function hideActivityById($activityId)
            {
                $table = JTable::getInstance('Activity', 'CTable');
                $table->load($activityId);
                $archived = 1;

                $message = JText::_('COM_COMMUNITY_WALL_REMOVED');

                if ($table->archived == 1) {
                    $archived = 0;

                    $message = JText::_('COM_COMMUNITY_WALL_RESTORED');
                }

                $db = $this->getDBO();

                $query = 'UPDATE ' . $db->quoteName('#__community_activities') . ' SET  ' . $db->quoteName('archived') . ' = ' . $db->Quote($archived)
                    . ' WHERE ' . $db->quoteName('id') . '=' . $db->quote($activityId) . ' ';

                $db->setQuery($query);
                try {
                    $status = $db->execute();
                } catch (Exception $e) {
                    JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
                }

                return $message;
            }

public function removeActivity($app, $uniqueId)
            {
                $db = $this->getDBO();

                /*
                 * @todo add in additional info if needed
                 * when removing photo app, we need to remove the likes and comments as well
                 */

                $additionalQuery = '';

                switch ($app) {
                    case 'photos' :
                        //before we remove anything, lets check if this photo is included in the params of activity
                        // that might be more than one photo
                        $db->setQuery(
                            "SELECT albumid FROM ".$db->quoteName('#__community_photos')." WHERE id=".$db->quote($uniqueId)
                        );

                        $albumId = $db->loadResult();

                        $db->setQuery(
                          "SELECT id, params FROM ".$db->quoteName('#__community_activities'). " WHERE "
                            .$db->quoteName('app') . '=' . $db->Quote($app)." AND "
                            .$db->quoteName('cid') . '=' . $db->Quote($albumId)
                        );

                        $activities = $db->loadObjectList();

                        if(count($activities) == 0){
                            return;
                        }

                        //search through the parameters of the activities
                        foreach($activities as $activity){
                            $params = new CParameter($activity->params);
                            $photoIds = $params->get('photosId');
                            $photoIds = explode(',',$photoIds);

                            if(in_array($uniqueId, $photoIds)){
                                if(count($photoIds) > 1){
                                    //do not delete this activities as there is another photo associated with this activity
                                    if(($key = array_search($uniqueId, $photoIds)) !== false) {
                                        unset($photoIds[$key]);
                                    }

                                    $params->set('photosId',implode(',',$photoIds));
                                    $activityTable = JTable::getInstance('Activity', 'CTable');
                                    $activityTable->load($uniqueId);

                                    //just update the activity will do
                                    $activityTable->params = $params->toString();
                                    $activityTable->store();
                                }else{
                                    // just delete the activity
                                    $db->setQuery(
                                        "DELETE FROM ".$db->quoteName('#__community_activities')." WHERE "
                                        .$db->quoteName('id').' = '.$db->quote($activity->id)
                                    );
                                    $db->execute();
                                }
                            }
                        }


                        return;//return as the additional steps are not needed

                        //we should remove the likes and comments
                        $additionalQuery = '(' . $db->quoteName('app') . '=' . $db->Quote($app) .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('photos.comment') .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('album.like') .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('profile.avatar.upload') .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('photo.like') . ')';
                        break;
                    case 'videos' :
                        $additionalQuery = '(' . $db->quoteName('app') . '=' . $db->Quote($app) .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('videos.linking') .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('videos.comment') .
                            ' OR ' . $db->quoteName('app') . '=' . $db->Quote('videos.like') . ')';
                        break;
                    case 'albums':
                        $additionalQuery = $db->quoteName('app') . ' like' . $db->Quote('%photos%');
                        break;
                    default :
                        // this is the default state
                        $additionalQuery = $db->quoteName('app') . '=' . $db->Quote($app);
                }

                $query = 'DELETE FROM ' . $db->quoteName('#__community_activities') . ' '
                    . 'WHERE ' .$additionalQuery . ' '
                    . 'AND ' . $db->quoteName('cid') . '=' . $db->Quote($uniqueId);

                $db->setQuery($query);
                try {
                    $status = $db->execute();
                } catch (Exception $e) {
                    JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
                }

                return $status;
            }

thank you!

8 years 9 months ago
  • gustavo's Avatar
    Topic Author
  • gustavo
  • Offline
  • Fresh Boarder
  • Posts: 86
  • Thank you received: 1
Licenses:
JomSocial Active iSEO Expired Socialize Expired

Hi, is this fix included in the version 4.2.3?


thanks!

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