On upgrades to 25.03, existing invalid configuration should be automatically fixed. Alternatively, the following could be run from the Diagnostics > Command Prompt, Execute PHP Commands
page:
ShowHide
$shaper_config_new = [];
$nested_queue_found = false;
foreach (config_get_path('dnshaper/queue', []) as $queue) {
if (isset($queue['name'])) {
$shaper_config_new[strtolower($queue['name'])] = $queue;
continue;
}
foreach ($queue as $nested_queue) {
if (isset($nested_queue['name'])) {
$nested_queue_found = true;
// Don't override queues at the correct path.
if (!isset($shaper_config_new[strtolower($nested_queue['name'])])) {
$shaper_config_new[strtolower($nested_queue['name'])] = $nested_queue;
}
}
}
}
if ($nested_queue_found) {
$queue_number = 0;
foreach ($shaper_config_new as &$queue_config) {
$queue_config['number'] = ++$queue_number;
}
unset($queue_config);
config_set_path('dnshaper/queue', array_values($shaper_config_new));
file_notice('Traffic Shaper', gettext('Configuration items for ' .
'Traffic Shaper Limiters were found at an invalid location ' .
'and have been regenerated.')
);
write_config('Limiters configuration regenerated.');
}