Fix #2582 Userfollow activity click action not working

Enh: Make space membership activities clickable
This commit is contained in:
buddh4 2017-07-29 21:42:47 +02:00
parent 71155dece9
commit 0c4f031250
6 changed files with 13 additions and 17 deletions

View File

@ -48,6 +48,9 @@ HumHub Change Log
- Enh: Added `ContentTag` concept for creating content categories/filter on module level
- Fix: Mentioning keeps running even if previous input result was empty
- Enh: Darkened comment links for better readability
- Fix #2582 Userfollow activity click action not working
- Enh: Make space membership activities clickable
1.2.1 (June 17, 2017)
- Fix: Invite error in french language

View File

@ -119,7 +119,6 @@ abstract class BaseActivity extends \humhub\components\SocialActivity
public function container($container)
{
$this->record->content->container = $container;
return $this;
}

View File

@ -11,8 +11,6 @@ namespace humhub\modules\activity\controllers;
use Yii;
use humhub\components\Controller;
use humhub\modules\activity\models\Activity;
use humhub\modules\content\components\ContentActiveRecord;
use humhub\modules\content\components\ContentAddonActiveRecord;
/**
* LinkController provides link informations about an Activity via JSON.
@ -43,9 +41,8 @@ class LinkController extends Controller
$activityId = Yii::$app->request->get('id');
$activity = Activity::findOne(['id' => $activityId]);
if ($activity !== null && $activity->content->canRead()) {
$source = $activity->getSource();
$this->redirect($source->content->getUrl());
if ($activity !== null && $activity->content->canView()) {
$this->redirect($activity->getActivityBaseClass()->getUrl());
}
}

View File

@ -19,12 +19,6 @@ use humhub\modules\activity\interfaces\ConfigurableActivityInterface;
*/
class MemberAdded extends BaseActivity implements ConfigurableActivityInterface
{
/**
* @inheritdoc
*/
public $clickable = false;
/**
* @inheritdoc
*/

View File

@ -20,11 +20,6 @@ use humhub\modules\activity\interfaces\ConfigurableActivityInterface;
class MemberRemoved extends BaseActivity implements ConfigurableActivityInterface
{
/**
* @inheritdoc
*/
public $clickable = false;
/**
* @inheritdoc
*/

View File

@ -28,4 +28,12 @@ class UserFollow extends BaseActivity
*/
public $viewName = "userFollow";
/**
* @inheritdoc
*/
public function getUrl()
{
return $this->source->target->getUrl();
}
}