Bug 12683 - Rule position lost after duplicating a firewall rule
Summary: Rule position lost after duplicating a firewall rule
Status: ASSIGNED
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: unspecified Unspecified
: - Unknown - Minor Usability
Assignee: Stefan Schantl
QA Contact:
URL:
Keywords:
Depends on:
Blocks: FWBUGS
  Show dependency tree / graph
 
Reported: 2021-09-01 11:28 UTC by Larsen
Modified: 2026-10-28 16:08 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Larsen 2021-09-01 11:28:47 UTC
Steps to reproduce:
- Copy an existing rule
- Don't change anything and click "Add"
- Message "This rule already exists." is shown

Result:
The value for "Rule position" was lost.

If the user wanted to duplicate a rule next to the original rule, for whatever reason forgot to change anything, clicked Add, then corrected the rule and saved, it would have been created at an unexpected position.

Quite hypothetical, I know =)
Comment 1 Michael Tremer 2026-10-28 16:08:00 UTC
When a new or copied rule was shown again after an error (e.g. "This rule already exists."), the field for its position was always emptied. It keeps the submitted position now, see "firewall.cgi: Keep the rule position of a new rule after an error".

When an existing rule is edited and saving fails, the editor still reloads the saved rule, so all changes are lost and not only the position. That needs a bigger change and is not part of this.

How to test once this is in a core update:
1. Copy a rule and set a position.
2. Press Add without changing anything.
3. After the error, the field still shows that position.

The fix is on the branch webui-escaping, which cleans up the whole web user interface and has not been merged yet. It will ship with a core update that has not been decided yet:
https://git.ipfire.org/?p=people/ms/ipfire-2.x.git;a=shortlog;h=refs/heads/webui-escaping