Regression #14412
closedPHP error when attempting to bulk import Alias content
100%
Description
Saving after attempting bulk import of a new alias on firewall_aliases_import.php
results in the alias configuration being broken and PHP errors on every GUI page and console prevent making any changes.
When saving after import, the configuration section for aliases ends up as:
<aliases>
<alias>0</alias>
</aliases>
Where the content is the next alias ID. For example, if there were one existing alias at the time, the value is 1
. If there are 5, it's 5
, and so on.
The PHP error is due to the corrupted alias configuration and isn't as important:
PHP Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /etc/inc/util.inc:2053 Stack trace: #0 /etc/inc/config.gui.inc(56): alias_make_table() #1 /etc/inc/auth.inc(34): require_once('/etc/inc/config...') #2 /etc/inc/authgui.inc(27): include_once('/etc/inc/auth.i...') #3 /usr/local/www/guiconfig.inc(62): require_once('/etc/inc/authgu...') #4 /usr/local/www/firewall_aliases.php(35): require_once('/usr/local/www/...') #5 {main} thrown in /etc/inc/util.inc on line 2053
That error doesn't necessarily need fixed here if we can prevent the data from being corrupted, but it might be nice to have that bail in a more user-friendly way.
Updated by Jim Pingle over 1 year ago
Looks like it was broken during a recent bulk refactor in 29cd08ea0da6246ad416e33b3788c05c0b0a5172, fix is very simple, as is preventing everything from blowing up due to the bad config entry. Fix incoming momentarily.
Updated by Jim Pingle over 1 year ago
- Status changed from Confirmed to Feedback
- % Done changed from 0 to 100
Applied in changeset 217f42ec30a4008907ac6fbb65b7b2e0ebf51eb9.
Updated by Danilo Zrenjanin over 1 year ago
- Status changed from Feedback to Resolved
I replicated the issue on the:
23.05-RELEASE (amd64) built on Mon May 22 15:04:36 UTC 2023 FreeBSD 14.0-CURRENT
The patch fixes it. I am marking this ticket resolved.
Updated by Jim Pingle over 1 year ago
- Plus Target Version changed from 23.09 to 23.05.1