Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception handling for theme loading #1969

Merged
merged 31 commits into from Dec 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
debf3ca
Translation helper controler
boehsermoe Sep 2, 2018
dd0711c
PHPdoc
boehsermoe Sep 2, 2018
a6bfca3
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Oct 12, 2018
95730f0
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Nov 14, 2018
67b3f8d
Correct parameter order for help
boehsermoe Nov 14, 2018
8b213cc
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Nov 19, 2018
c9b7bd2
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Nov 22, 2018
b7b9ed2
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Nov 23, 2018
49eac4a
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe Nov 23, 2018
5ca6a29
Documentation for block preview luyadev/luya-module-cms#83
boehsermoe Nov 23, 2018
871d714
Revert PHP doc
boehsermoe Nov 23, 2018
c3910b3
Merge branch 'master' of https://github.com/luyadev/luya
boehsermoe May 30, 2019
e3774d9
Merge branch 'master' of github.com:boehsermoe/luya
boehsermoe Jul 26, 2019
aa24193
Travis mysql connection failed
boehsermoe Jul 27, 2019
76f6a93
Merge branch 'master' of github.com:luyadev/luya
boehsermoe Aug 22, 2019
201ddd6
Merge branch 'master' of github.com:luyadev/luya
boehsermoe Aug 27, 2019
dd43f71
config with env scope
boehsermoe Aug 27, 2019
d66f45d
used call_user_func for callback
boehsermoe Aug 28, 2019
bdb7e22
Update Config.php
nadar Aug 28, 2019
d7ca041
Merge branch 'master' of github.com:luyadev/luya
boehsermoe Sep 8, 2019
7e74c47
Merge branch 'master' of github.com:luyadev/luya
boehsermoe Sep 21, 2019
51a0eca
Merge branch 'master' of github.com:luyadev/luya
boehsermoe Oct 23, 2019
5e43e3e
theme load without exception as default
boehsermoe Oct 25, 2019
d9edc6a
theme load without exception as default
boehsermoe Oct 26, 2019
8495329
theme load without exception as default
boehsermoe Oct 26, 2019
9ceb642
Update ThemeManager.php
boehsermoe Oct 26, 2019
bf9fad8
changelog #1969
boehsermoe Oct 27, 2019
a621db5
Merge branch 'master' of github.com:boehsermoe/luya
boehsermoe Oct 27, 2019
0f01308
Update CHANGELOG.md
nadar Dec 9, 2019
3286b88
add php doc
nadar Dec 9, 2019
b19dd1a
Merge branch 'master' into master
nadar Dec 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions core/CHANGELOG.md
Expand Up @@ -5,6 +5,7 @@ In order to read more about upgrading and BC breaks have a look at the [UPGRADE

## 1.0.24

+ [#1969](https://github.com/luyadev/luya/pull/1969) Fixed exception handling while loading empty theme directories.
+ [#1977](https://github.com/luyadev/luya/pull/1977) Added new `ArrayHelper::combine()` method to generate an array with the same keys and values.
+ [#1977](https://github.com/luyadev/luya/pull/1978) Added support for ActiveForm context to SubmitButtonWidget. Supporting multi form (including pjax) on same page.

Expand Down
7 changes: 3 additions & 4 deletions core/theme/ThemeManager.php
Expand Up @@ -89,7 +89,7 @@ final public function setup()
$basePath = $this->getActiveThemeBasePath();
if ($basePath) {
$this->beforeSetup($basePath);

$themeConfig = $this->getThemeByBasePath($basePath);
$theme = new Theme($themeConfig);
$this->activate($theme);
Expand Down Expand Up @@ -128,12 +128,11 @@ protected function getActiveThemeBasePath()
/**
* Get all theme configs as array list.
*
* @param bool $throwException
*
* @param bool $throwException Whether an exception should by throw or not. By version 1.0.24 this is disabled by default.
* @return ThemeConfig[]
* @throws \yii\base\Exception
*/
public function getThemes($throwException = true)
public function getThemes($throwException = false)
{
if ($this->_themes) {
return $this->_themes;
Expand Down
6 changes: 3 additions & 3 deletions tests/core/theme/ThemeManagerTest.php
Expand Up @@ -135,7 +135,7 @@ public function testNotReadableThemeDir()
mkdir(Yii::getAlias('@app/themes/not-readable'), 0200);

try {
$themeManager->getThemes();
$themeManager->getThemes(true);
} finally {
rmdir(Yii::getAlias('@app/themes/not-readable'));
}
Expand All @@ -153,7 +153,7 @@ public function testEmptyThemeDir()
mkdir(Yii::getAlias('@app/otherThemeLocation/emptyThemeDir'));

try {
$themeManager->getThemes();
$themeManager->getThemes(true);
} finally {
rmdir(Yii::getAlias('@app/otherThemeLocation/emptyThemeDir'));
}
Expand Down Expand Up @@ -193,6 +193,6 @@ public function testDuplicateThemeDefinition()
Yii::$app->getPackageInstaller()->getConfigs()['luyadev/luya-core']->setValue('themes', ['@app/themes/blank']);

$themeManager = new ThemeManager();
$themeManager->getThemes();
$themeManager->getThemes(true);
}
}