[TYPO3-mvc] HMAC check fails / form view helper
Claus Due
claus at wildside.dk
Mon Sep 26 14:54:49 CEST 2011
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!
Claus
More information about the TYPO3-project-typo3v4mvc
mailing list