[+BUGFIX] Extbase (MVC): Fixed a problem where a non-required action argument throwed...
authorJochen Rau <j.rau@web.de>
Mon, 5 Jul 2010 11:06:37 +0000 (11:06 +0000)
committerJochen Rau <j.rau@web.de>
Mon, 5 Jul 2010 11:06:37 +0000 (11:06 +0000)
typo3/sysext/extbase/Classes/MVC/Controller/Argument.php

index 2370c44..70817e4 100644 (file)
@@ -363,7 +363,7 @@ class Tx_Extbase_MVC_Controller_Argument {
                        $transformedValue = $this->propertyMapper->map(array_keys($value), $value, $this->dataType);
                }
 
-               if (!($transformedValue instanceof $this->dataType)) {
+               if (!($transformedValue instanceof $this->dataType) && !($transformedValue === NULL && !$this->isRequired())) {
                        throw new Tx_Extbase_MVC_Exception_InvalidArgumentValue('The value must be of type "' . $this->dataType . '", but was of type "' . (is_object($transformedValue) ? get_class($transformedValue) : gettype($transformedValue)) . '".', 1251730701);
                }
                return $transformedValue;