Todo #14790
closedEliminate direct config access in ``interfaces.php``
100%
Description
The code in interfaces.php
needs updated for PHP 8.x and to use the new config/array access functions. There have been a couple changes made already but the rest of the file needs to be converted.
Adding this for better tracking/testing feedback, the work is already done and there will be an MR shortly.
Related issues
Updated by Jim Pingle over 1 year ago
- Related to Bug #14579: PHP error in ``handle_wireless_post()`` when toggling some wireless interface options added
Updated by Jim Pingle over 1 year ago
Updated by Jim Pingle over 1 year ago
- Status changed from In Progress to Feedback
- % Done changed from 0 to 100
Applied in changeset 1857f9fbf03ad0ea7435c87a3289c5d6da50dc54.
Updated by Jim Pingle over 1 year ago
- Status changed from Feedback to In Progress
PHP error when disabling an interface:
[20-Sep-2023 13:28:16 Etc/UTC] PHP Fatal error: Uncaught TypeError: array_get_path(): Argument #1 ($arr) must be of type array, null given, called in /usr/local/www/interfaces.php on line 472 and defined in /etc/inc/util.inc:3562 Stack trace: #0 /usr/local/www/interfaces.php(472): array_get_path(NULL, 'ipaddrv6') #1 {main} thrown in /etc/inc/util.inc on line 3562
Updated by Jim Pingle over 1 year ago
- Status changed from In Progress to Feedback
Applied in changeset 3c431c2d2b38ddeee160c685a92c971e83ac972c.
Updated by Kris Phillips about 1 year ago
Tested disabling an interface on the latest builds. No PHP errors were present and the changeset above was present in the interfaces.php file. Can be closed as Resolved.
Updated by Jim Pingle about 1 year ago
Kris Phillips wrote in #note-6:
Tested disabling an interface on the latest builds. No PHP errors were present and the changeset above was present in the interfaces.php file. Can be closed as Resolved.
That one issue is solved but in general it needs more testing with different interface types. There was at least one report of a PHP error with a PPPoE interface that I saw on Slack but it hasn't made its way here yet with details about how to replicate it.
Updated by Jim Pingle about 1 year ago
I've been trying to run interfaces.php
through all sorts of different scenarios and so far I have yet to break it on a current snapshot. I've tried making a new PPPoE interface when no others were defined (Even after deleting the whole <ppps>
tag from the config, changing types, different settings, same settings... All seems to be OK. If anyone has seen an error or knows a way to trigger a PHP error on there, let me know.
I'll still leave this open for the moment for additional feedback since there are so many possible different interface settings combinations it's unlikely I tested even a majority of possible states.
Updated by Jim Pingle about 1 year ago
- Status changed from Feedback to Resolved
No further errors have popped up so we'll call this complete for now. Any new errors can be addressed individually as separate issues.
Updated by Jim Pingle about 1 year ago
- Target version changed from 2.8.0 to 2.7.1