From 4ad51adc04482dbf57ab222de89d02eec2f83ec3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 25 Feb 2023 12:37:16 +0100 Subject: [PATCH] Continued: - tried to fix NPE, still not working? - added debug log - better logging --- .../classes/iterator/registry/class_RegistryIterator.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/framework/main/classes/iterator/registry/class_RegistryIterator.php b/framework/main/classes/iterator/registry/class_RegistryIterator.php index 40e79884..2e94bcf9 100644 --- a/framework/main/classes/iterator/registry/class_RegistryIterator.php +++ b/framework/main/classes/iterator/registry/class_RegistryIterator.php @@ -245,6 +245,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { } // Is current still NULL? + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR[%s]: registryKey=%s,current[]=%s', $this->key(), $registryKey, gettype($current))); if (is_null($current)) { // This cannot happen and indicates a logic error throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); @@ -262,7 +263,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { */ public function key () { // Return it - /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR[%s]: EXIT!', $this->key)); + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->traceMessage(sprintf('REGISTRY-ITERATOR: this->key=%s EXIT!', $this->key)); return $this->key; } @@ -313,6 +314,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { } // Yes, then advance to that entry + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage(sprintf('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[%s][%d] ...', $registryType, $nextIndex)); $this->key = $this->registryKeys[$registryType][$nextIndex]; // Trace message @@ -344,6 +346,7 @@ class RegistryIterator extends BaseIterator implements IteratableRegistry { /* UNFINISHED */ ApplicationEntryPoint::exitApplication(sprintf('[%s:%d]: this->key(%d)[%s]=%s,this->valid=%d,this->registryKeys=%s', __METHOD__, __LINE__, strlen($this->key()), gettype($this->key()), $this->key(), intval($this->valid()), print_r($this->registryKeys, TRUE))); } elseif (count($this->registryKeys['instance']) > 0) { // Second instance + /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugMessage('REGISTRY-ITERATOR: Setting this->key from this->registryKeys[instance][0] ...'); $this->key = $this->registryKeys['instance'][0]; } -- 2.39.5