From cee6a515795b1e083644bb772d29a0f9b4aaed2d Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Tue, 3 Aug 2021 10:56:43 -0400 Subject: [PATCH] Fix issue processwire/processwire-issues#114 --- wire/core/Wire.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wire/core/Wire.php b/wire/core/Wire.php index 1ac65ddd..8df58b85 100644 --- a/wire/core/Wire.php +++ b/wire/core/Wire.php @@ -1754,7 +1754,7 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable { // this object has not yet been wired! use last known current instance as fallback // note this condition is unsafe in multi-instance mode $wire = ProcessWire::getCurrentInstance(); - if(!$wire) return null; + if(!$wire) return is_object($name) ? $name : null; // there are no ProcessWire instances if($name && $this->_wire === null) { $this->_wire = false; // false prevents this from being called another time for this object $wire->_objectNotWired($this, $name, $value); @@ -1868,6 +1868,7 @@ abstract class Wire implements WireTranslatable, WireFuelable, WireTrackable { */ public function __debugInfo() { /** @var WireDebugInfo $debugInfo */ + require_once(__DIR__ . '/WireDebugInfo.php'); $debugInfo = $this->wire(new WireDebugInfo()); return $debugInfo->getDebugInfo($this, true); }