Skip to content

Commit

Permalink
Enh: Better support for custom caches (#6888)
Browse files Browse the repository at this point in the history
* Enh: Better support for custom caches

* Updated Changelog
  • Loading branch information
luke- committed Mar 16, 2024
1 parent 99cb0fa commit 152b0a0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ HumHub Changelog

1.15.4 (Unreleased)
-------------------
- Enh #6888: Better support for custom caches
- Fix #6851: Update HumHub Prosemirror (fixes legacy emoji support)
- Fix #6859: Hide scheduled and draft content on other user profile pages
- Fix #6871: Cache is not deleted after deleting a value in the settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,16 @@ public function init()
public function rules()
{
return [
[['type', 'expireTime'], 'required'],
[['expireTime'], 'required'],
['reloadableScripts', 'string'],
['type', 'checkCacheType'],
['expireTime', 'integer'],
['type', 'in', 'range' => array_keys($this->getTypes())],
['type', 'required', 'when' => function () {
return !Yii::$app->settings->isFixed('cache.class');
}],
['type', 'in', 'range' => array_keys($this->getTypes()), 'when' => function () {
return !Yii::$app->settings->isFixed('cache.class');
}],
];
}

Expand Down Expand Up @@ -122,7 +127,7 @@ public static function getReloadableScriptUrls()

public function getReloadableScriptsAsArray()
{
if(is_string($this->reloadableScripts) && !empty($this->reloadableScripts)) {
if (is_string($this->reloadableScripts) && !empty($this->reloadableScripts)) {
return array_map('trim', explode("\n", $this->reloadableScripts));
}

Expand Down
5 changes: 3 additions & 2 deletions protected/humhub/modules/admin/views/setting/caching.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@

<?php $form = ActiveForm::begin(['acknowledge' => true]); ?>

<?= $form->field($model, 'type')->dropDownList($cacheTypes, ['readonly' => Yii::$app->settings->isFixed('cache.class')]) ?>

<?php if (!Yii::$app->settings->isFixed('cache.class')): ?>
<?= $form->field($model, 'type')->dropDownList($cacheTypes, ['readonly' => Yii::$app->settings->isFixed('cache.class')]) ?>
<?php endif; ?>

<?= $form->field($model, 'expireTime')->textInput(['readonly' => Yii::$app->settings->isFixed('cache.expireTime')]) ?>

Expand Down

0 comments on commit 152b0a0

Please sign in to comment.