[Flow] Remove does not remove
Axel Wüstemann
awu at qbus.de
Sat Nov 2 15:13:14 CET 2013
Ok, Steffen, I see the point, and I should have figured out by myself.
Sorry for being late in my brain ;=) Update of course is a post request,
while delete isn't.
Regards
Axel
Am 02.11.2013 14:50, schrieb Steffen Wickham:
> 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
>>>
>>>
>>>
>>
>>
>
> _______________________________________________
> Flow mailing list
> Flow at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/flow
>
--
Qbus Werbeagentur GmbH
18055 Rostock, Heiligengeisthof 5
Tel: 0381 4 61 39 - 10 | Fax: - 22
21029 Hamburg, Chrysanderstraße 69A
Tel: 040 60 94 59 75
Mobil: 0179 46 455 46
www.xing.com/profile/Axel_Wuestemann
www.issuu.com/QbusAgentur/docs/qbus-referenzen?mode=embed
Handelsregister: HRB 11218 beim Amtsgericht Rostock Sitz der
Gesellschaft: Hansestadt Rostock
Geschäftsführer: Dipl.-Ing. Axel Wüstemann
www.qbus.de | www.qbus.de/qblog
www.facebook.com/QbusAgentur
More information about the Flow
mailing list