Skip to content

Commit

Permalink
Another fix to non-null falsy value handling in View
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Sep 5, 2021
1 parent d3042eb commit 3f625a5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Wireframe.info.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down
2 changes: 1 addition & 1 deletion Wireframe.module.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down
5 changes: 4 additions & 1 deletion lib/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3f625a5

Please sign in to comment.