HomePhabricator

Stop stashing form data in the session

Description

Stop stashing form data in the session

I already wrote in d1b57ca910 that I was no longer convinced this was a
good idea, and I think it’s time to remove it now. Its justification, as
laid out in 1070a3a8f2, was twofold:

  • current_url() didn’t take query parameters into account at the time, leading to CSRF errors when the form was submitted with any query parameters. However, this was since rectified in commit 792db2a9f9 and then later commit 782dfdabee.
  • I thought it was ugly if there was form data in the URL and also (potentially different) form data in the actual POST data. I am no longer bothered by this.

The reason we need to get rid of the stashed form data trick, at least
in its current form, is that adding it to edit mode (in d1b57ca910)
broke the handling of the ?language_code parameter to edit mode, since
the parameter would now be moved to the stashed_form_data, but we never
looked it up from there. That could’ve been fixed by looking it up in
the stashed_form_data, of course, but redirecting from edit mode URLs
with ?language_code to a version where the language code is still in
effect but nowhere to be seen seemed unnecessary and confusing at best,
and doing a partial stash (stash away form_representation but not
language_code) seems like more trouble than it’s worth. As far as I can
tell, dropping the stashing altogether doesn’t break anything, so good
riddance.

Details

Provenance
LucasWerkmeisterAuthored on Jan 13 2021, 8:19 PM
Parents
R2362:9a604413d3a9: Add German toponym template (#10)
Branches
Unknown
Tags
Unknown
ChangeId
None