Fix number of space members (#6011)

This commit is contained in:
Yuriy Bakhtin 2023-01-07 00:50:33 +04:00 committed by GitHub
parent ead5190af4
commit 2a0faf2a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@ HumHub Changelog
- Fix #5996: Fix param type in strpos() (PHP 8.1)
- Fix #5997: Possible NULL param value in Birthday field (PHP 8.1)
- Enh #6001: Added new `ContentActiveFixture` and migrated `PostFixture` to it
- Fix #6007: Fix number of space members
1.13.0 (December 21, 2022)
--------------------------

View File

@ -5,6 +5,7 @@
* @license https://www.humhub.com/licences
*/
use humhub\modules\space\models\Membership;
use humhub\modules\space\models\Space;
use yii\helpers\Url;
use yii\web\View;
@ -17,5 +18,5 @@ use yii\web\View;
<?php if ($showMemberships): ?>
<a href="#" class="fa fa-users" data-action-click="ui.modal.load"
data-action-url="<?= Url::to(['/space/membership/members-list', 'container' => $space]) ?>">
<span><?= Yii::$app->formatter->asShortInteger($space->getMemberships()->count()) ?></span></a>
<span><?= Yii::$app->formatter->asShortInteger(Membership::getSpaceMembersQuery($space)->active()->visible()->count()) ?></span></a>
<?php endif; ?>