[Flow] Upgrade to Flow 2.0: changes in persistence?

Bastian Waidelich bastian at typo3.org
Mon Sep 2 14:44:52 CEST 2013


François Suter wrote:

Hi François,

> I'm currently using the \TYPO3\Fluid\ViewHelpers\Link\ActionViewHelper
> to create my links. From your message I gather that this is wrong.

It's not exactly *wrong*, but GET requests should not alter data on the 
server side according to the HTTP spec and that's a very good advise to 
follow, as crawlers are also assuming that they can follow all links if 
you don't tell them otherwise (or lock them out behind some login form).

And there are some more reasons, one of them being: If GET requests 
don't change anything they can be cached more easily.

So there are three options I can think of:

1. Keep your Fluid as is and add
$this->persistenceManager->persistAll()
to the end of the respective action.

2. Turn the GET request into a POST request via unobtrusive JavaScript
If 3. is not an option for you let me know, I can give you a concrete 
example

3. (prefered): Turn your link into a form

From:
<f:link.action action="update" arguments="{object: 
object}">update</f:link.action>

To:
<f:form action="update" object="{object}" objectName="object">
   <f:form.button>update</f:form.button>
</f:form>


With CSS you should be able to style the button any way you like (at 
least for recent browser versions)

HTH


-- 
Bastian Waidelich
--
Core Developer Team

TYPO3 .... inspiring people to share!
Get involved: typo3.org


More information about the Flow mailing list