Description of the bug
On a busy site that can bloat the tempstore with useless records
Steps To Reproduce
- Got to node/add/post
- Check tempstore database table - two records for the node form/form_state 👍
- Open the image dialog
- Check tempstore - another pair of records for the dialog form/form_state 👍
- Close dialog (no matter which button)
- Tempstore record not flushed 😞
- Open link dialog
- Tempstore records++ 😞
And so on and so on. Every dialog open creates 2 additional records.
Actual behavior
Loads of useless tempstore records. They only get cleaned up after expiry time, which is 6 hours by default. On a busy site with lots of editors, this can be quite some amount of stale records.
Expected behavior
Closing the dialog cleans up the tempstore record, as those aren't re-used. The next dialog open creates a fresh form_build_id.
Additional information
- Backdrop CMS version: has probably been there forever
Not sure, which dialog types are affected, but for sure the Filter (editor) link and image dialog are, and those are used pretty frequently.
What's basically missing is an AJAX command running:
tempstore_clear('form', $form_state['values']['form_build_id']);
tempstore_clear('form_state', $form_state['values']['form_build_id']);
Usually backdrop_process_form() should take care of that cleanup, but AJAX dialogs are a bit special. Tempstore records are properly handled for rebuilds (submitting something inside an open dialog form), but closing dialogs does no cleanup at all.
Description of the bug
On a busy site that can bloat the tempstore with useless records
Steps To Reproduce
And so on and so on. Every dialog open creates 2 additional records.
Actual behavior
Loads of useless tempstore records. They only get cleaned up after expiry time, which is 6 hours by default. On a busy site with lots of editors, this can be quite some amount of stale records.
Expected behavior
Closing the dialog cleans up the tempstore record, as those aren't re-used. The next dialog open creates a fresh form_build_id.
Additional information
Not sure, which dialog types are affected, but for sure the Filter (editor) link and image dialog are, and those are used pretty frequently.
What's basically missing is an AJAX command running:
Usually backdrop_process_form() should take care of that cleanup, but AJAX dialogs are a bit special. Tempstore records are properly handled for rebuilds (submitting something inside an open dialog form), but closing dialogs does no cleanup at all.