codefog / contao-haste

Haste is a collection of tools and classes to ease working with Contao
http://codefog.pl/extension/haste.html
MIT License
42 stars 24 forks source link

$_SESSION['FORM_DATA'] #33

Closed Toflar closed 10 years ago

Toflar commented 11 years ago

Hey guys,

Shouldn't Haste Form set $_SESSION['FORM_DATA'][$strKey] so that when reloading the page the values are present in the form?

I searched the Contao core and saw that we should set it here (https://github.com/codefog/contao-haste/blob/master/library/Haste/Form.php#L469) but I wonder where the session gets reset. I couldn't find that place in the core?!

@aschempp @qzminski

qzminski commented 11 years ago

That could be implemented, but as an optional parameter (set default to true). Also, you can add a feature that will automatically fill the forms with the session data, if needed.

aschempp commented 11 years ago

I think we should. The values are not loaded into the form though! Contao Core does not delete the session values...

Toflar commented 11 years ago

We can't retrieve the data from non-submitted haste forms anyway so I'm not sure whether we should add it or leave it to the developer to store and retrieve from the session.