[TYPO3-mvc] form field name collides with a previous form field name

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Thu Aug 4 17:38:01 CEST 2011


On 08/04/2011 04:37 PM, Stefan Franke wrote:
> Dear all,
> I keep getting an error message which I don't understand:
>
> -->>--
> "The form field name "tx_xyz_pi1[image]" collides with a previous form field name which declared the field as array. (Array overridden by String)"
> --<<--
>
>
> The Fluid template looks like this:
>
> -->>--
> <f:form enctype="multipart/form-data" method="POST" name="image" action="update" object="{image}" arguments="{article: '{article}', image: '{image}'}">
> 	<f:form.textbox property="title" value="{image.title}" />
> 	<f:form.textbox property="caption" value="{image.caption}" />
> 	<f:form.textbox property="credits" value="{image.credits}" />
> 	<f:form.submit value="save" />
> </f:form>
> --<<--
>
>
> To examine what leads to the exception being thrown, I put some echos into the core code of the extbase framework.
>
> -->>--
> function generateRequestHash (in RequestHashService.php):
>
> if ($i == count($formFieldParts) - 1) {
> 	echo "part: ".$formFieldPart."<br />";
> 	if (isset($currentPosition[$formFieldPart])&&  is_array($currentPosition[$formFieldPart])) {
> 		echo "currentPosition: ".print_r($currentPosition[$formFieldPart],1)."<br />";
> 		echo "is_array: ".is_array($currentPosition[$formFieldPart])."<br />";
> 		throw new Tx_Extbase_Security_Exception_InvalidArgumentForRequestHashGeneration('The form field name "' . $formField . '" collides with a previous form field name which declared the field as array. (Array overridden by String)', 1255072587);
> 	}
> --<<--
>
>
> So I got this:
>
> -->>--
> part: title
> part: caption
> part: credits
> part:
> part: __identity
> part: article
> part: image
> currentPosition: Array ( [title] =>  1 [caption] =>  1 [credits] =>  1 [__identity] =>  1 )
> is_array: 1
> --<<--
>
>
> I really don't know what's going on or what to do with this information now and hope that someone here knows the solution to this problem or where I have to start looking.
>
> Thanks for your help!
>
> Regards,
> Stefan
>
>
>    
Hi Stefan

I think this is because you have the image object twice in your Form 
ViewHelper:

Once as the object to fill out (object="{image}") and once as an 
argument. Just delete {image} from arguments in your fluid template!

Greetings
Till
>
>
>    



More information about the TYPO3-project-typo3v4mvc mailing list