Skip to content

Commit

Permalink
Fix notice in Wireframe::page() when Page object is not wired
Browse files Browse the repository at this point in the history
  • Loading branch information
teppokoivula committed Aug 31, 2022
1 parent 30b57eb commit f0102b5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 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.26.2] - 2022-08-31

### Fixed
- Fixed an issue where Wireframe::page() wasn't handling "non-wired" Page objects properly, resulting in a notice.

## [0.26.1] - 2022-07-11

### Changed
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.26.1",
"version": "0.26.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.26.1
* @version 0.26.2
* @author Teppo Koivula <teppo@wireframe-framework.com>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down
4 changes: 2 additions & 2 deletions lib/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
/**
* Factory class for Wireframe
*
* @version 0.3.0
* @version 0.3.1
* @author Teppo Koivula <teppo@wireframe-framework.com>
* @license Mozilla Public License v2.0 https://mozilla.org/MPL/2.0/
*/
Expand Down Expand Up @@ -162,7 +162,7 @@ public static function component(string $component_name, array $args = []): \Wir
public static function page($source, $args = []) {

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

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

0 comments on commit f0102b5

Please sign in to comment.