diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fafc71d79..377bffeb53 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ HumHub Changelog - Enh #7233: Mobile view: enlarge images in gallery preview of entries for the wall stream - Enh #7237: Changed PoweredBy URL - Enh #7238: Fixed PHP warning related to `.env` +- Enh #7240: Fixed maximum file size setting in initialization 1.16.3 (Unreleased) -------------------------- diff --git a/protected/humhub/modules/admin/models/forms/FileSettingsForm.php b/protected/humhub/modules/admin/models/forms/FileSettingsForm.php index 37af109118..794726b5c6 100644 --- a/protected/humhub/modules/admin/models/forms/FileSettingsForm.php +++ b/protected/humhub/modules/admin/models/forms/FileSettingsForm.php @@ -88,10 +88,12 @@ class FileSettingsForm extends Model $fileSizeKey = 'post_max_size'; } + $maxUploadSizeInMb = $maxUploadSize / 1024 / 1024; + return [ $fileSizeKey, - floor($maxUploadSize / 1024 / 1024), - min($maxUploadSize, 64), + $maxUploadSizeInMb, + min($maxUploadSizeInMb, 64), ]; } diff --git a/protected/humhub/modules/installer/libs/InitialData.php b/protected/humhub/modules/installer/libs/InitialData.php index 620edf1490..5f71efa40b 100644 --- a/protected/humhub/modules/installer/libs/InitialData.php +++ b/protected/humhub/modules/installer/libs/InitialData.php @@ -60,7 +60,7 @@ class InitialData // File [,,$defaultMaxUploadSize] = FileSettingsForm::getPHPMaxUploadSize(); - Yii::$app->getModule('file')->settings->set('maxFileSize', $defaultMaxUploadSize); + Yii::$app->getModule('file')->settings->set('maxFileSize', $defaultMaxUploadSize * 1024 * 1024); Yii::$app->getModule('file')->settings->set('excludeMediaFilesPreview', '1'); // Caching