[TYPO3-mvc] create action/form is not returning an object but an array -> error
Robert Böttner
lists at boettner.it
Mon Feb 22 18:21:56 CET 2010
Hi Franz,
to my experience that´s often due to some naming missmatches between formfield names (the property attribute) and the actual properties of your model.
Cheers
Robert.
Am 22.02.2010 um 18:09 schrieb Franz Koch:
> 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
> _______________________________________________
> TYPO3-project-typo3v4mvc mailing list
> TYPO3-project-typo3v4mvc at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-project-typo3v4mvc
More information about the TYPO3-project-typo3v4mvc
mailing list