[Flow] Remove does not remove

Steffen Wickham steffen at gaming-inc.de
Sat Nov 2 14:50:30 CET 2013


Hey Axel,

I just make a wild guess to your updateAction() method: You surely have
a form within your editAction() (the page you can came from) where you
can modify the saved values. Within your edit view you surely use the
<f:form> ViewHelper of Fluid which will perform a POST request by
default to your controller and the updateAction().

As Chriss mentioned, the form request will be performed as a HTTP POST
request and is considered as "unsafe" by Flow. So the persistAll()
method will be called automatically after finishing your method call by
the MVC framework of TYPO3 Flow. That's why your data will be saved
without calling persistAll() manually. It's all about the request method
used.

Best regards,
Steffen



Am 01.11.2013 17:52, schrieb Axel Wüstemann:
> Thank you Chris. Of course I know the explaind concepts. I did not
> know that GET request should be considered as read only, but with your
> explanation it seems logically to me.
>
> "> as  a GET request should always be "save" so a browser could prefect
> > the next page you visiting without deleting or modifiing data."
>
> But with that I can't get, why it is not with update an create? My
> updateAction worked without persistAll().
>
>
> Am 01.11.2013 15:43, schrieb chris Wolff:
>> Hi Axel,
>> to explain it in simple terms
>> every link triggers a HTTP GET (regadless of the controller or action
>> you call)
>>
>> most forms trigger a HTTP POST (<form method="post" ..)
>>
>> the idea is that GET is Read Only and POST is for Writing/Modifing data.
>>
>> (there are other HTTP Methods but i ommit explaination here to keep
>> it simple)
>>
>> Most modern HTTP Frameworks Implement such an Architecture know as REST
>> see wikipeda for more details:
>> https://en.wikipedia.org/wiki/Representational_state_transfer
>>
>> as  a GET request should always be "save" so a browser could prefect
>> the next page you visiting without deleting or modifiing data.
>>
>> with CSS its possible to style form buttons als links and vice versa.
>>
>> regards chris
>>
>>
>>
>>
>> 2013/11/1 Bastian Waidelich <bastian at typo3.org>:
>>> Axel Wüstemann wrote:
>>>
>>>> I do it within a regulary deleteAction, so by my mind this is not a
>>>> save
>>>> request methode, or?
>>>
>>>
>>> Don't confuse "HTTP method" (aka "HTTP verb") with a "PHP function"
>>> (aka
>>> "method" of a class).
>>>
>>> You can call your action "thisIsAVeryUnsafeAction()" and Flow still
>>> won't
>>> know that it should automatically persist your changes.
>>>
>>> Instead, Flow will automatically invoke
>>> *PersistenceManager::persistAll()*
>>> after all unsafe *HTTP requests*.
>>>
>>>
>>> GET requests are not meant to change the server state – thus a
>>> delete link
>>> is invalid according to the HTTP specification and should be
>>> replaced by a
>>> form with method="post" (or an ajax request with method = "DELETE").
>>>
>>> BTW: We did the same mistake in the Flow Quickstart[1] and should
>>> update the documentation. But the TYPO3.Kickstart package has been
>>> fixed
>>> already and if you follow the examples your code should work as
>>> expected.
>>>
>>>
>>> [1]
>>> http://docs.typo3.org/flow/TYPO3FlowDocumentation/Quickstart/Index.html#storing-objects
>>>
>>>
>>>
>>> -- 
>>> Bastian Waidelich
>>> -- 
>>> Core Developer Team
>>>
>>> TYPO3 .... inspiring people to share!
>>> Get involved: typo3.org
>>> _______________________________________________
>>> Flow mailing list
>>> Flow at lists.typo3.org
>>> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>>
>>
>>
>
>



More information about the Flow mailing list