Skip to content

Commit f0102b5

Browse files
committed
Fix notice in Wireframe::page() when Page object is not wired
1 parent 30b57eb commit f0102b5

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## [0.26.2] - 2022-08-31
11+
12+
### Fixed
13+
- Fixed an issue where Wireframe::page() wasn't handling "non-wired" Page objects properly, resulting in a notice.
14+
1015
## [0.26.1] - 2022-07-11
1116

1217
### Changed

Wireframe.info.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"title": "Wireframe",
33
"summary": "Wireframe is an output framework for ProcessWire CMS/CMF.",
4-
"version": "0.26.1",
4+
"version": "0.26.2",
55
"author": "Teppo Koivula",
66
"href": "https://wireframe-framework.com",
77
"requires": [

Wireframe.module.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @method static string|Page|NullPage page($source, $args = []) Static getter (factory) method for Pages.
1515
* @method static string|null partial(string $partial_name, array $args = []) Static getter (factory) method for Partials.
1616
*
17-
* @version 0.26.1
17+
* @version 0.26.2
1818
* @author Teppo Koivula <teppo@wireframe-framework.com>
1919
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
2020
*/

lib/Factory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
/**
1515
* Factory class for Wireframe
1616
*
17-
* @version 0.3.0
17+
* @version 0.3.1
1818
* @author Teppo Koivula <teppo@wireframe-framework.com>
1919
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
2020
*/
@@ -162,7 +162,7 @@ public static function component(string $component_name, array $args = []): \Wir
162162
public static function page($source, $args = []) {
163163

164164
/** @var ProcessWire */
165-
$wire = $args['wire'] ?? ($source instanceof Page ? $source->getWire() : wire());
165+
$wire = $args['wire'] ?? ($source instanceof Page ? $source->getWire() ?? wire() : wire());
166166

167167
// make sure that basic Wireframe features have been initialized
168168
if (!Wireframe::isInitialized($wire->instanceID)) {

0 commit comments

Comments
 (0)