[TYPO3-mvc] HMAC check fails / form view helper

g4-lisz at tonarchiv.ch g4-lisz at tonarchiv.ch
Mon Sep 26 16:01:42 CEST 2011


On 09/26/2011 02:54 PM, Claus Due wrote:
> On Sep 26, 2011, at 2:39 PM, g4-lisz at tonarchiv.ch wrote:
>
>    
>> Yeah but the form.hidden view helper manual says: "name attribute is ignored if property attribute is set".
>>      
> Correct; you cannot use both "property" and "name" - but you only need one of them, and you should use "property" as much as possible. If for some reason you cannot use "property", fallback to "name".
>
>    
>> Maybe it's a view helper issue, too?<f:form.select property="city">  is handled correctly, but<f:form.hidden property="city">  is not…?
>>      
> I don't think it's the ViewHelpers. More likely this is because "city" is a M:N relation, which means it cannot be posted as a UID value - which happens if you use<f:form.hidden property="city" />  which is also why you should try "city.0" as property name. This turns the posted value into an array which will correctly convert to ObjectStorage (containing one single object).
>
> This happens in the PropertyMapper.
>
>    
>> When i write the<input type="hidden"...>  HTML part by hand then I get a HMAC error, too :(
>>      
> Yes, you must use the f:form.* ViewHelpers if you want the HMAC to be correct. The viewhelpers register the form field name in the HMAC checksum, manual use of<input>  does not do this.
>
> Hope this helps!
>
>    
Hi Claus

It was a very stupid mistake: i accidentally did erase the "name=" 
direction from the f.form view helper:
< f:form id="search_form" pluginName="fe_search_results" 
object="{demand}" action="results" pageUid="26">

There must be the 'name="demand"' direction in the form "header"!

After adding this it worked with <f:form.hidden property="city" 
id="input_city" /> (NB: not "city.0").

Thank you very much!

Cheers,
Till





More information about the TYPO3-project-typo3v4mvc mailing list