mirror of
https://github.com/humhub/humhub.git
synced 2025-01-17 06:08:21 +01:00
* Enh #5741: Possibility to Like global contents * Enh #5741: Possibility to Like global contents Co-authored-by: Lucas Bartholemy <luke-@users.noreply.github.com>
This commit is contained in:
parent
e10f7854c0
commit
74b54d4112
@ -4,3 +4,4 @@
|
||||
- Enh #3593: Allow SSO provider to register and auto create username on registration
|
||||
- Enh #5695: Truncate long profile texts in People cards
|
||||
- Enh #5602: Added API to inject additional validation rules by modules on demand
|
||||
- Enh #5741: Possibility to Like global contents
|
||||
|
@ -85,11 +85,7 @@ class Module extends \humhub\components\Module
|
||||
{
|
||||
$content = $object->content;
|
||||
|
||||
if(!isset($content->container)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!$content->container->can(new permissions\CanLike())) {
|
||||
if (isset($content->container) && !$content->container->can(new permissions\CanLike())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,14 @@ class LikeLink extends \yii\base\Widget
|
||||
*/
|
||||
public function beforeRun()
|
||||
{
|
||||
if (!Yii::$app->getModule('like')->isEnabled ||
|
||||
!isset($this->object->content->container) ||
|
||||
!($this->object->content->container instanceof ContentContainerActiveRecord) ||
|
||||
!$this->object->content->container->can(CanLike::class)) {
|
||||
if (
|
||||
!Yii::$app->getModule('like')->isEnabled ||
|
||||
(
|
||||
isset($this->object->content->container) &&
|
||||
$this->object->content->container instanceof ContentContainerActiveRecord &&
|
||||
!$this->object->content->container->can(CanLike::class)
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user