Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
b5b1c9f
Update for HumHub 1.19
yurabakhtin Feb 23, 2026
b94a4a4
Fix profile menu
yurabakhtin Feb 25, 2026
ecb2d5f
Merge branch 'master' into develop
yurabakhtin Mar 24, 2026
843e243
Autocommit PHP CS Fixer
actions-user Mar 24, 2026
7a125e5
Fix zip archiving for new storage
yurabakhtin Mar 24, 2026
c78847b
Autocommit PHP CS Fixer
actions-user Mar 24, 2026
4ae87cf
Merge pull request #280 from humhub/php-fixer/2026-03-24-094912
luke- Mar 25, 2026
81a86e0
Merge pull request #281 from humhub/php-fixer/2026-03-24-105330
luke- Mar 25, 2026
6ec1934
Cleaning up REST error handling module as it is handled by core
yurabakhtin May 25, 2026
590c0fa
Merge branch 'master' into develop
luke- Jun 3, 2026
fb63546
Fix REST API module branch for tests
yurabakhtin Jun 4, 2026
372a464
Release 0.18.0
luke- Jun 4, 2026
7323a5a
Add aria-label attribute for icon-only buttons
yurabakhtin Jun 25, 2026
251a372
Merge pull request #286 from humhub/fix/1239-icon-only-aria-label
luke- Jun 25, 2026
f0e82cd
Release 0.18.1
luke- Jul 8, 2026
8dd9fff
Fix Content linking with Comment
yurabakhtin Jul 20, 2026
045985b
Release 0.18.2
luke- Jul 20, 2026
dae3047
Remove deprecated search event usage removed in HumHub 1.19
luke- Jul 22, 2026
8effaa3
Merge pull request #287 from humhub/fix/1295-search-add-event
luke- Jul 22, 2026
bc4b900
Release 0.18.3
luke- Jul 22, 2026
4a940a6
Enh: Send a single notification to announce all files uploaded within…
marc-farre Aug 4, 2026
f4736b4
Add PR ID to CHANGELOG
marc-farre Aug 4, 2026
f19a75c
Merge pull request #288 from humhub/enh/5334-exclude-content-type-fro…
luke- Aug 5, 2026
d92852a
Enh: Updated Translations (translate.humhub.org)
Aug 6, 2026
d10c961
Enh: Updated Translations (translate.humhub.org)
Aug 24, 2026
b35c921
Replace removed `.sr-only` class with `.visually-hidden`
yurabakhtin Aug 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/codeception-min-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ jobs:
with:
module-id: cfiles
use-rest-module: true
rest-module-branch: develop
31 changes: 20 additions & 11 deletions Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace humhub\modules\cfiles;

use humhub\commands\IntegrityController;
use humhub\helpers\ControllerHelper;
use humhub\modules\cfiles\extensions\custom_pages\elements\FileElement;
use humhub\modules\cfiles\extensions\custom_pages\elements\FilesElement;
use humhub\modules\cfiles\extensions\custom_pages\elements\FolderElement;
Expand All @@ -14,7 +16,10 @@
use humhub\modules\file\actions\DownloadAction;
use humhub\modules\file\models\File as BaseFile;
use humhub\modules\space\models\Space;
use humhub\modules\space\widgets\Menu;
use humhub\modules\ui\menu\MenuLink;
use humhub\modules\user\models\User;
use humhub\modules\user\widgets\ProfileMenu;
use Yii;
use yii\base\Event;

Expand All @@ -27,15 +32,16 @@ class Events
{
public static function onSpaceMenuInit($event)
{
/* @var Menu $menu */
$menu = $event->sender;

if ($event->sender->space !== null && $event->sender->space->moduleManager->isEnabled('cfiles')) {
$event->sender->addItem([
if ($menu->space !== null && $menu->space->moduleManager->isEnabled('cfiles')) {
$menu->addEntry(new MenuLink([
'label' => Yii::t('CfilesModule.base', 'Files'),
'group' => 'modules',
'url' => $event->sender->space->createUrl('/cfiles/browse'),
'icon' => '<i class="fa fa-files-o"></i>',
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'cfiles'),
]);
'icon' => 'files-o',
'isActive' => ControllerHelper::isActivePath('cfiles'),
]));
}
}

Expand All @@ -46,6 +52,7 @@ public static function onSpaceMenuInit($event)
*/
public static function onIntegrityCheck($event)
{
/* @var IntegrityController $integrityController */
$integrityController = $event->sender;
$integrityController->showTestHeadline("CFile Module (" . File::find()->count() . " entries)");

Expand Down Expand Up @@ -76,13 +83,15 @@ public static function onIntegrityCheck($event)

public static function onProfileMenuInit($event)
{
if ($event->sender->user !== null && $event->sender->user->moduleManager->isEnabled('cfiles')) {
$event->sender->addItem([
/* @var ProfileMenu $menu */
$menu = $event->sender;
if ($menu->user !== null && $menu->user->moduleManager->isEnabled('cfiles')) {
$menu->addEntry(new MenuLink([
'label' => Yii::t('CfilesModule.base', 'Files'),
'url' => $event->sender->user->createUrl('/cfiles/browse'),
'icon' => '<i class="fa fa-files-o"></i>',
'isActive' => (Yii::$app->controller->module && Yii::$app->controller->module->id == 'cfiles'),
]);
'icon' => 'files-o',
'isActive' => ControllerHelper::isActivePath('cfiles'),
]));
}
}

Expand Down
24 changes: 10 additions & 14 deletions Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace humhub\modules\cfiles;

use humhub\components\console\Application as ConsoleApplication;
use humhub\modules\cfiles\models\ConfigureContainerForm;
use humhub\modules\cfiles\models\rows\FileSystemItemRow;
use humhub\modules\space\models\Space;
Expand All @@ -16,6 +15,16 @@

class Module extends ContentContainerModule
{
/**
* @var int Files uploaded into the same folder by the same user are announced by a single
* notification, once no further file was uploaded for this many minutes.
* 0 announces every upload request on its own.
*
* @see \humhub\modules\cfiles\libs\FileUploadBatch
* @since 0.19
*/
public int $uploadNotificationDelay = 10;

/**
* @var string sort name as 'name', 'size', 'updated_at'
* @see FileSystemItemRow::ORDER_MAPPING
Expand All @@ -30,19 +39,6 @@ class Module extends ContentContainerModule
public $defaultPostedFilesSort = FileSystemItemRow::ORDER_TYPE_UPDATED_AT;
public $defaultPostedFilesOrder = SORT_ASC;

/**
* @inheritdoc
*/
public function init()
{
parent::init();

if (Yii::$app instanceof ConsoleApplication) {
// Prevents the Yii HelpCommand from crawling all web controllers and possibly throwing errors at REST endpoints if the REST module is not available.
$this->controllerNamespace = 'cfiles/commands';
}
}

/**
* @inheritdoc
*/
Expand Down
20 changes: 20 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
Changelog
=========

0.19.0 - Unreleased
-------------------
- Enh #288: Send a single notification to announce all files uploaded within a short period of time, rather than sending one notification per file (humhub/humhub#5334)

0.18.3 - July 22, 2026
----------------------
- Fix #287: Fix PHP error from deprecated search event/constant removed in HumHub 1.19

0.18.2 - July 20, 2026
----------------------
- Fix #272: Fix Content linking with Comment

0.18.1 - July 8, 2026
---------------------
- Enh #286: Add aria-label attribute for icon-only buttons

0.18.0 - June 5, 2026
---------------------
- Enh #272: Update for HumHub 1.19

0.17.4 - May 5, 2026
--------------------
- Fix #278: Improved download count accuracy
Expand Down
74 changes: 74 additions & 0 deletions jobs/SendFileUploadNotification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
<?php

/**
* @link https://www.humhub.org/
* @copyright Copyright (c) 2026 HumHub GmbH & Co. KG
* @license https://www.humhub.com/licences
*/

namespace humhub\modules\cfiles\jobs;

use humhub\modules\cfiles\libs\FileUploadBatch;
use humhub\modules\queue\ActiveJob;
use Yii;

/**
* Announces a batch of uploaded files with a single notification.
*
* The job is queued with a delay by [[FileUploadBatch::add()]] when the first file of a batch
* arrives. Since further uploads restart the quiet period, the job re-queues itself as long as
* the batch is not due yet.
*
* @since 0.19
*/
class SendFileUploadNotification extends ActiveJob
{
/**
* @var int upper bound of re-queues, so that queue drivers which ignore the delay (the
* Instant and Sync drivers run jobs right away) announce the batch instead of
* re-queueing themselves endlessly.
*/
public const MAX_ATTEMPTS = 10;

/**
* @var int
*/
public $folderId;

/**
* @var int
*/
public $userId;

/**
* @var int how often this job was already re-queued for the same batch
*/
public $attempt = 0;

/**
* @inheritdoc
*/
public function run()
{
$batch = FileUploadBatch::load((int)$this->folderId, (int)$this->userId);

if ($batch->isEmpty()) {
// Already announced, or the batch was lost through a cache flush
return;
}

$remainingDelay = $batch->getRemainingDelay();

if ($remainingDelay > 0 && $this->attempt < self::MAX_ATTEMPTS) {
// Uploads continued after this job was queued, wait for them to settle
Yii::$app->queue->delay($remainingDelay)->push(new self([
'folderId' => $this->folderId,
'userId' => $this->userId,
'attempt' => $this->attempt + 1,
]));
return;
}

$batch->notify();
}
}
Loading
Loading