[TYPO3-mvc] Passing objects from view to controller - Typo3 6.2.9

Jonas Eberle jonas.eberle at d-mind.de
Thu Apr 2 20:30:53 CEST 2015


Hi Axel,

are your controller action parameters phpdoc-documented? I think it is 
important to get a correct mapping.

Regards,
Jonas

Am 07.02.2015 um 10:14 schrieb Axel Beckert:
> Dear All,
>
> Sorry for writing in German before. So here is the problem again:
> I faced the following problem in Typo3 6.2.9
>
> When I pass some objects to the controller by using f:link action and 
> arguments, the objects will arrive at the controller but he does not 
> register them as they what I have send. For a better explanation here 
> the single code sections:
>
>
> at the partial:
>
> <f:link.action action="new" controller="ForeignProductMeasuring" 
> arguments="{planRow : planRow, plan:plan}">neue Dosierung 
> anlegen</f:link.action>
>
> the generated link in the site:
>
> "index.php?id=1&tx_desinfektionsplan_desinfektionsplan%5BplanRow%5D=12&tx_desinfektionsplan_desinfektionsplan%5Bplan%5D=16&tx_desinfektionsplan_desinfektionsplan%5Baction%5D=new&tx_desinfektionsplan_desinfektionsplan%5Bcontroller%5D=ForeignProductMeasuring&cHash=2adafaba9c56b134d4d5ae382ee5d57b" 
>
>
> what shows the the arguments are correct in my opinion.
>
> Here the action at the controller:
>
> public function 
> newAction(\Orochemie\Desinfektionsplan\Domain\Model\ForeignProductMeasuring 
> $newForeignProductMeasuring = NULL,
> \Orochemie\Desinfektionsplan\Domain\Model\PlanRow $planRow,
> \Orochemie\Desinfektionsplan\Domain\Model\Plan $plan) {
>
> \TYPO3\CMS\Extbase\Utility\DebuggerUtility::var_dump( 
> $this->request->getArguments());
> $this->view->assign('newForeignProductMeasuring', 
> $newForeignProductMeasuring);
> $this->view->assign('planRow', $planRow);
> $this->view->assign('plan', $plan);
>
> }
>
> The error looks like this:
>
> #1: PHP Catchable Fatal Error: Argument 2 passed to 
> Orochemie\Desinfektionsplan\Controller\ForeignProductMeasuringController::newAction() 
> must be an instance of 
> Orochemie\Desinfektionsplan\Domain\Model\PlanRow, none given in 
> /kunden/137629_70806/typo3/typo3conf/ext/desinfektionsplan/Classes/Controller/ForeignProductMeasuringController.php 
> line 46
>
> For me it looks like that he don´t knows the objects which he gets. 
> But if I check the arguments with $this->request->getArguments() then 
> I see that all arguments arrive at the controller.
>
> Does anybody has a idea of what is the problem here?
>
> Thanks in advance
>
> _______________________________________________
> 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