From cf56ceb021cf54f4031c6d863e16cbf700b9d95a Mon Sep 17 00:00:00 2001
From: =?utf8?q?Roland=20H=C3=A4der?= <roland@mxchange.org>
Date: Fri, 10 Feb 2023 16:57:00 +0100
Subject: [PATCH] Continued: - thanks to type-hints, I was able to find out
 that   appendStringToGenericArrayElement() was invoked wrong here, it must be
   setGenericArrayElement() instead which makes sense from addCriteria()  
 method's scope

---
 framework/main/classes/criteria/class_BaseCriteria.php | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/framework/main/classes/criteria/class_BaseCriteria.php b/framework/main/classes/criteria/class_BaseCriteria.php
index ad57f0be..a9c90b93 100644
--- a/framework/main/classes/criteria/class_BaseCriteria.php
+++ b/framework/main/classes/criteria/class_BaseCriteria.php
@@ -274,7 +274,7 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
 	 */
 	public final function addCriteria (string $criteriaKey, $criteriaValue, string $criteriaType = Criteria::CRITERIA_TYPE_DEFAULT) {
 		// Check parameter
-		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s--CRITERIA: criteriaKey=%s,criteriaValue[]=%s$criteriaValue,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType));
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: criteriaKey=%s,criteriaValue[]=%s,criteriaType=%s - CALLED!', strtoupper($criteriaType), $criteriaKey, gettype($criteriaValue), $criteriaType));
 		if (empty($criteriaKey)) {
 			// Throw IAE
 			throw new InvalidArgumentException('Parameter "criteriaKey" is empty');
@@ -295,9 +295,9 @@ abstract class BaseCriteria extends BaseFrameworkSystem implements Criteria {
 		// Convert dashes to underscore
 		$criteriaKey = StringUtils::convertDashesToUnderscores($criteriaKey);
 
-		// Append it
-		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: Invoking this->appendStringToGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey, gettype($criteriaValue)));
-		$this->appendStringToGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
+		// Set it
+		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: Invoking this->setGenericArrayElement(criteria,%s,entries,%s,criteriaValue[]=%s) ...', strtoupper($criteriaType), $criteriaType, $criteriaKey, gettype($criteriaValue)));
+		$this->setGenericArrayElement('criteria', $criteriaType, 'entries', $criteriaKey, $criteriaValue);
 
 		// Trace message
 		/* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__, __LINE__)->debugOutput(sprintf('%s-CRITERIA: EXIT!', strtoupper($criteriaType)));
-- 
2.39.5