From 3f625a50a973619852954cd72352dd8c0ac1234f Mon Sep 17 00:00:00 2001 From: Teppo Koivula Date: Sun, 5 Sep 2021 17:19:14 +0300 Subject: [PATCH] Another fix to non-null falsy value handling in View --- CHANGELOG.md | 5 +++++ Wireframe.info.json | 2 +- Wireframe.module.php | 2 +- lib/View.php | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 746df14..bfbc3c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.21.2] - 2021-09-05 + +### Fixed +- Second fix for the issue with non-null falsy value handling in View. Fix introduced in 0.21.1 was not fully functional yet. + ## [0.21.1] - 2021-09-05 ### Fixed diff --git a/Wireframe.info.json b/Wireframe.info.json index 1588653..156378c 100644 --- a/Wireframe.info.json +++ b/Wireframe.info.json @@ -1,7 +1,7 @@ { "title": "Wireframe", "summary": "Wireframe is an output framework for ProcessWire CMS/CMF.", - "version": "0.21.1", + "version": "0.21.2", "author": "Teppo Koivula", "href": "https://wireframe-framework.com", "requires": [ diff --git a/Wireframe.module.php b/Wireframe.module.php index 2b94bfc..a9614fb 100644 --- a/Wireframe.module.php +++ b/Wireframe.module.php @@ -14,7 +14,7 @@ * @method static string|Page|NullPage page($source, $args = []) Static getter (factory) method for Pages. * @method static string|null partial(string $partial_name, array $args = []) Static getter (factory) method for Partials. * - * @version 0.21.1 + * @version 0.21.2 * @author Teppo Koivula * @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/ */ diff --git a/lib/View.php b/lib/View.php index cb8ec7b..9e73cab 100644 --- a/lib/View.php +++ b/lib/View.php @@ -11,7 +11,7 @@ * @property ViewPlaceholders|null $placeholders ViewPlaceholders object. * @property Partials|null $partials Object containing partial paths. * - * @version 0.8.1 + * @version 0.8.2 * @author Teppo Koivula * @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/ */ @@ -125,6 +125,9 @@ public function __get($key) { } $value = $this->get($key); if ($value === null) { + if (isset($this->data[$key]) && $this->data[$key] !== null) { + return $this->data[$key]; + } $value = $this->getFromController($key); } return $value;