Defect #44477
openQuery form action persists after navigating back from custom query save page
Description
This issue occurs on pages that use queries, such as /issues, /projects, /gantt, and /time_entries.
When the "Save" or "Save custom query" button is clicked, the action attribute of the query form is changed to the custom query save page.
For example:¶
$('#query_type').prop('disabled', false);
$('#query_form').attr('action', '/queries/new').submit();
return false;
After clicking "Save" or "Save custom query" and then navigating back using the browser's Back button without saving the query, the modified action attribute remains on the query form.
As a result, when a normal query is subsequently applied, the form is submitted to /queries/new again instead of its original action.
The issue appears to be related to browser form-state restoration after history navigation.
Environment¶
Redmine¶
- 6.1, 7.0
Browser¶
- Chrome: Version 154.0.8037.58 (Official Build) (64-bit)
- Edge: Version 153.0.4234.48 (Official build) (64-bit)
Steps to reproduce¶
- Open a page that uses queries, such as the Issues page.
- Configure a query.
- Click "Save" or "Save custom query".
- On the custom query save page, click the browser's Back button without saving the query.
- Apply the query again.
Actual behavior¶
The custom query save page is displayed again because the query form's action attribute still points to /queries/new.
Expected behavior¶
After navigating back from the custom query save page, applying the query should submit the form to its original action, as it did before clicking "Save".
No data to display