[TYPO3-mvc] dontverifyrequesthash and custom validator

Astrid Haubold astridhaubold at gmx.net
Mon Nov 15 01:22:23 CET 2010


Hi all,
I am still a very beginner with extbase and at the moment I am trying to 
validate a form which is used for editing the object Patient. Because 
the user needs to be able to add form fields in the frontend per 
JavaScript my updateAction has the annotation @dontverifyrequesthash. 
Because I need to validate child records I also want to use a custom 
validator:
/**
	 * @dontverifyrequesthash
	 * Updates an existing Patient and forwards to the next edit action 
afterwards.
	 *
	 * @param Tx_Braunstudie_Domain_Model_Patient $patient The Patient to 
display
	 * @validate $patient Tx_Braunstudie_Domain_Validator_Edit2Validator
	 * return void
	 */
	public function update2Action(Tx_Braunstudie_Domain_Model_Patient 
$patient) {
		$this->patientRepository->update($patient);
}


But if I write it like that it seems as if the @validate annotation 
unsets the @dontverifyrequesthash annotation: when I try to add a form 
field in the frontend this exception is thrown: #1255082824: Request 
hash (HMAC) checking failed. The parameter __hmac was invalid or not 
set, and objects were modified.

If I remove the @validate annotation for the custom validator everything 
works fine and no exception is thrown when I add a field.

I thought that the @dontverifyrequesthash annotation was meant to 
suppress the exception in any case. Or am I missing something? Is there 
a way to combine both?

Thank you already for any help!
Astrd



More information about the TYPO3-project-typo3v4mvc mailing list