Fix error when config defaultReloadableScripts is not array (#6351)

This commit is contained in:
Yuriy Bakhtin 2023-05-24 19:58:30 +04:00 committed by GitHub
parent e85244695b
commit 387479ad7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -111,7 +111,10 @@ class CacheSettingsForm extends Model
/* @var $module Module */
$module = Yii::$app->getModule('admin');
$instance = new static();
$urls = array_merge($instance->getReloadableScriptsAsArray(), $module->defaultReloadableScripts);
$urls = $instance->getReloadableScriptsAsArray();
if (is_array($module->defaultReloadableScripts)) {
$urls = array_merge($urls, $module->defaultReloadableScripts);
}
$event = new FetchReloadableScriptsEvent(['urls' => $urls]);
$instance->trigger(static::EVENT_FETCH_RELOADABLE_SCRIPTS, $event);
return $event->urls;