From a7b94dcfe938660a915392c448625ff7e2210b4e Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Thu, 12 Nov 2020 16:18:02 +0300 Subject: [PATCH 1/2] Check old dir with custom php files --- components/PhpPageContainer.php | 7 ++++++- docs/CHANGELOG.md | 5 +++++ module.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/components/PhpPageContainer.php b/components/PhpPageContainer.php index 834a5f06..0832c8b6 100644 --- a/components/PhpPageContainer.php +++ b/components/PhpPageContainer.php @@ -92,7 +92,12 @@ public function getAllowedPhpViewFileSelection($path = false) return []; } - $files = FileHelper::findFiles($this->getPhpViewPathByView(), [ + $dirPath = $this->getPhpViewPathByView(); + if (!is_dir($dirPath)) { + return []; + } + + $files = FileHelper::findFiles($dirPath, [ 'only' => ['*.php'], 'recursive' => false ]); diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index ecb42511..6912bd0a 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,6 +2,11 @@ Changelog ========= +1.1.1 (Unreleased) +------------------------ +- Fix #151: Avoid error on creating of custom php page with not existing directory from old settings + + 1.1.0 (November 3, 2020) ------------------------ The default folders for PHP custom pages were changed. diff --git a/module.json b/module.json index e691751d..6e475be7 100644 --- a/module.json +++ b/module.json @@ -3,7 +3,7 @@ "name": "Custom Pages", "description": "Allows admins to create custom pages (html or markdown) or external links to various navigations (e.g. top navigation, account menu).", "keywords": ["pages", "custom", "iframe", "markdown", "link", "navigation", "spaces"], - "version": "1.1.0", + "version": "1.1.1", "homepage": "https://github.com/humhub/humhub-modules-custom-pages", "humhub": { "minVersion": "1.7" From f19ec381919d2d8d1dfb7b4ce43af808aa64f25c Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Thu, 12 Nov 2020 14:52:01 +0100 Subject: [PATCH 2/2] Update CHANGELOG.md --- docs/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 6912bd0a..b364380c 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -2,8 +2,8 @@ Changelog ========= -1.1.1 (Unreleased) ------------------------- +1.1.1 (November 12, 2020) +------------------------- - Fix #151: Avoid error on creating of custom php page with not existing directory from old settings