Bug #5259


firewall_aliases_edit.php: Switch to a URL Table type when you already have multiple rows

Added by Phillip Davis over 8 years ago. Updated over 8 years ago.

Target version:
Start date:
Due date:
% Done:


Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
Affected Architecture:


Start editing a new alias, click "Add Host" a few times to get multiple rows.
Switch the alias type to "URL Table (IPs)" or "URL Table (Ports)".

Now there are multiple rows still displayed but the "Delete" buttons at the end of each row are gone.

What to do here?

If the user is adding a new alias, then when switching to a "URL Table" type the code could automatically remove any rows after the first. I think that case is easy to see a reasonable thing to do.

If the user is editing an existing alias (e.g. a Network type alias with multiple rows), then what to do? A "URL Table" alias type is quite a different thing. Should we automatically remove all but the first row for the user, and then the user can type over the top of the first network they had and put a URL? But that might be quite annoying if a user "kind of accidentally" selects a "URL Table" type and wants to switch back. They would have to "cancel out" (= use the back button to get back to the firewall_aliases page) and start the alias edit again.

Perhaps the "Delete" button at the end of each row can always be shown as long as there is more than 1 row existing. Obviously that would mean that the code that generates row 1 would have to look ahead to know if row 2 exists in order to decide if a "Delete" button is needed on the end of row 1. But actually if it is done that way then a good side-effect is that when there is only 1 row, then there will be no Delete button displayed, and so no need for the popup message "You may not delete the last row".

Note: In 2.2.* the delete buttons were always shown regardless of the alias type, so users could do more what they liked and it was left to the validation on submit to check if they submitted rubbish.


Also available in: Atom PDF