[TYPO3-mvc] Re: Dynamic (non-Fluid) Form-Elements with ExtBase

bSchreiber b.schreiber at trisinus.de
Mon Aug 3 13:46:30 CEST 2015


I did some further digging and found the following documentation regarding my problem:

# Developing TYPO3 Extensions with Extbase and Fluid 1.0: Creating Controllers and Actions
-------------------------------------
When calling the Method createAction(), we already described the case of all Arguments being valid. But what happens, if a Frontend user inserts invalid data - or even manipulates the form to deliberately attack the website?
..
If now a validation error occurs when calling the Method createAction(), an error message ist saved and the processing is passed back to the previous Action, including all already inserted form data. Extbase reads the neccessary information from the hidden fields:class:__referrer. In our case the Method newAction() is called again. In contrast to the first call, Extbase now tries to create an (invalid) Offer Object from the form data, and to pass it to the Method in $newOffer. Due to the annotation @dontvalidate $newOffer Extbase this time acceptes the invalid object and displays the form once more. Formerly filled in data is put in the fields again and the previously saved error message is displayed if the template is intenting so.
-------------------------------------

But try the following:
1. Submit the values test=1 and dynamic=2 to "testSubmitAction" 
2. *without reseting / reloading* Submit the values test=3 and dynamic=4 to "testSubmitValidateAction"

You will notice that "testSubmitAction" will be called (since it's in "__referrer. at action") but the passed argument "$test" contains also the values from the first request (test=1 and dynamic=2) and not what the user just submitted.

So when the new formdata is not passed back, which makes a strange kind of sense, but how to access it?



More information about the TYPO3-project-typo3v4mvc mailing list