[TYPO3-mvc] create action/form is not returning an object but an array -> error

Christine Gerpheide cgerpheide at gmail.com
Mon Feb 22 18:19:30 CET 2010


2010/2/22 Franz Koch <typo3.RemoveForMessage at elements-net.de>

> Hi again,
>
> sorry for bothering your guys, but I'm stuck with the form I'm creating and
> don't find the error. I did exactly the same as others do in their extension
> or as it's done in the blog example. I get my form now rendered nicely, but
> when I submit the form I get an invalid argument exception:
>
> "
> Tx_Extbase_MVC_Exception_InvalidArgumentValue
>
> The value must be of type "Tx_EbWebcatalog_Domain_Model_CatalogOrder", but
> was of type "array".
> "
>
> This is a exception thrown from my create/new action. After first
> submission I should get the form values injected as object, but I always get
> an array. I already dug into the propertyMapper->map function to find the
> error, but had no luck so far. Maybe you can tell me what's wrong with my
> code:
>
> controller:
> -----------------------------------------------
> /**
>  * index action / Displays a new order form
>  *
>  * @param Tx_EbWebcatalog_Domain_Model_CatalogOrder $newCatalogOrder The
> order object
>  * @return string
>  * @dontvalidate $newCatalogOrder
>  */
> public function indexAction(Tx_EbWebcatalog_Domain_Model_CatalogOrder
> $newCatalogOrder = NULL) {
>        $this->view->assign('newCatalogOrder', $newCatalogOrder);
>        //... some more objects get assigned that are needed to render
> select fields etc
> }
>
>
> my template:
> -------------------------------------------------
> <f:form method="post" controller="CatalogOrder" action="order"
> name="newCatalogOrder" object="{newCatalogOrder}">
> ...
>
>
>
> Any ideas? Thanks a lot.
>
> --
> kind regards,
> Franz Koch
>


Hi Franz,

I know that this error sometimes comes up if you misspell (or have an
otherwise invalid field/property) in the form.

Christine


More information about the TYPO3-project-typo3v4mvc mailing list