Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not lose POST data when token expires ("Wrong token") #215

Open
b4n opened this issue Dec 16, 2014 · 1 comment
Open

Do not lose POST data when token expires ("Wrong token") #215

b4n opened this issue Dec 16, 2014 · 1 comment

Comments

@b4n
Copy link

b4n commented Dec 16, 2014

I just tried to post a link with a lengthy description, and it took me some time to write it, plus I did a few other things in-between. When I wanted to save the link, I got a "Wrong token" error. Fair enough, but all my data was lost!

So, please do not lose the POST data (at least not lf_url, lf_title and lf_description). Ideally the form would be re-shown with only a (big) warning on top, so all it would require would be to re-hit save in such a case.
Alternatively if the submission was done through XHR you could just not close the form on error, which at least would allow the user to backup his data and retry.


If this happens to anyone else in the meantime and you didn't close the page, you can quickly hack to recover your data: just edit shaarli's index.php and add var_dump($_POST); at the very end, just before renderPage();. Then, force your browser to re-submit the page (e.g. just reload it with Firefox, it will ask whether to resubmit, and you say yes): it will still not save your data but you will be able to back it up (check out the page's source so you also have proper newlines).
Don't forget to remove the added line when you backed up your data!

@nodiscc
Copy link

nodiscc commented Dec 16, 2014

Hi @b4n, this repository is currently unmaintained (@sebsauvage does not have much time for Shaarli currently). We have set up a community fork at https://github.com/shaarli/shaarli which you can check out for bug fixes and features, up to date/maintained bug tracker, documentation, etc.

Unfortunately we will not add this on the short term, unless you can suggest a very simple implementation. This would require a large rewrite of how the POST system works. Saving form data should be handled by your browser ((addons such as this one). You can check "stay signed in" at login to prevent your session from expiring.

Again, feel free to report on the shaarli/Shaarli bug tracker if you can propose a simple implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants