]> git.mxchange.org Git - core.git/blobdiff - inc/classes/main/helper/class_BaseHelper.php
Opps, forgot this.
[core.git] / inc / classes / main / helper / class_BaseHelper.php
index 45b74bb3cf1a33d1ed7ee866f06003e73e47ded0..c06f86fd6007ac4378984f4870c7e1be98f67cf4 100644 (file)
@@ -188,7 +188,7 @@ class BaseHelper extends BaseFrameworkSystem {
                //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'='.$fieldValue);
 
                // Now filter it through the value through the filter method
-               $filteredValue = call_user_func_array(array($this, 'doFilter' . $this->convertToClassName($filterMethod)), array($fieldValue));
+               $filteredValue = call_user_func_array(array($this, 'doFilter' . self::convertToClassName($filterMethod)), array($fieldValue));
 
                // Assign it with a template variable
                $this->getTemplateInstance()->assignVariable('block_' . $fieldName, $filteredValue);
@@ -455,22 +455,28 @@ class BaseHelper extends BaseFrameworkSystem {
         * @throws      NullPointerException    Thrown if $valueInstance is null
         */
        public function getValueField ($fieldName) {
+               // Init value
+               $fieldValue = NULL;
+
                // The $valueInstance attribute should not be null!
                if (is_null($this->getValueInstance())) {
                        // Throws an exception here
                        throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER);
                } // END - if
 
-               // Get the field value
-               $fieldValue = $this->getValueInstance()->getField($fieldName);
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - BEFORE!');
-
-               // Is it null?
-               if ((is_null($fieldValue)) && (!is_null($this->extraInstance))) {
+               // Is the field set?
+               if ($this->getValueInstance()->isFieldSet($fieldName)) {
+                       // Get the field value
+                       $fieldValue = $this->getValueInstance()->getField($fieldName);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Value instance!');
+               } elseif ((!is_null($this->extraInstance)) && ($this->extraInstance->isFieldSet($fieldName))) {
                        // So try the extra instance
                        $fieldValue = $this->extraInstance->getField($fieldName);
+                       //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - Extra instance!');
+               } else {
+                       // Field is not set
+                       $this->debugOutput('[' . __METHOD__ . ':' . __LINE__ . '] fieldName=' . $fieldName . ' is not set! - @TODO');
                } // END - if
-               //* DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput($fieldName.'[]='.gettype($fieldValue).'('.strlen($fieldValue).') - AFTER!');
 
                // Return it
                return $fieldValue;