Skip to content

Commit

Permalink
v0.43 & Chg: The minimum HumHub version is now 1.16
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-farre committed Jun 27, 2024
1 parent 9069e38 commit 89cb02b
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 27 deletions.
3 changes: 2 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
Changelog
=========

Unreleased
0.43 (June 27, 2024)
---------------------
- Fix: Sometimes Humhub addons doesn't loads
- Chg: Repository URL from https://github.com/cuzy-app/humhub-modules-external-websites to https://github.com/cuzy-app/external-websites
- Chg: The minimum HumHub version is now 1.16

0.42 (June 23, 2023)
---------------------
Expand Down
40 changes: 16 additions & 24 deletions models/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
use humhub\modules\content\components\ActiveQueryContent;
use humhub\modules\content\components\ContentActiveRecord;
use humhub\modules\externalWebsites\widgets\WallEntry;
use humhub\modules\search\events\SearchAddEvent;
use humhub\modules\search\interfaces\Searchable;
use humhub\modules\user\models\User;
use Yii;
use yii\helpers\Json;
Expand All @@ -35,7 +33,7 @@
*
* @property Website $website
*/
class Page extends ContentActiveRecord implements Searchable
class Page extends ContentActiveRecord
{
public $moduleId = 'external-websites';

Expand Down Expand Up @@ -174,32 +172,12 @@ public function getUrl()
*/
public function getSearchAttributes()
{
$space = $this->content->container;

$attributes = [
return [
'message' => $this->website->title,
// url comment because make solr crash
// 'page_url' => $space->createUrl('/external-websites/page?title='.urlencode($this->website->title).'&pageId='.$this->id),
'user' => $this->getPostAuthorName()
];

$this->trigger(self::EVENT_SEARCH_ADD, new SearchAddEvent($attributes));

return $attributes;
}

/**
* @return string
*/
private function getPostAuthorName()
{
$user = User::findOne(['id' => $this->created_by]);

if ($user !== null && $user->isActive()) {
return $user->getDisplayName();
}

return '';
}

public function getIcon()
Expand Down Expand Up @@ -270,4 +248,18 @@ public function afterSave($insert, $changedAttributes)
}
}
}

/**
* @return string
*/
private function getPostAuthorName()
{
$user = User::findOne(['id' => $this->created_by]);

if ($user !== null && $user->isActive()) {
return $user->getDisplayName();
}

return '';
}
}
4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
"keywords": [
"external websites iframe"
],
"version": "0.42",
"version": "0.43",
"humhub": {
"minVersion": "1.14"
"minVersion": "1.16"
},
"homepage": "https://github.com/cuzy-app/external-websites",
"authors": [
Expand Down

0 comments on commit 89cb02b

Please sign in to comment.