Project

General

Profile

Actions

Todo #14790

closed

Eliminate direct config access in ``interfaces.php``

Added by Jim Pingle 8 months ago. Updated 6 months ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
Interfaces
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
23.09
Release Notes:
Default

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

Related to Bug #14579: PHP error in ``handle_wireless_post()`` when toggling some wireless interface optionsResolvedJim Pingle

Actions
Actions #1

Updated by Jim Pingle 8 months ago

  • Related to Bug #14579: PHP error in ``handle_wireless_post()`` when toggling some wireless interface options added
Actions #3

Updated by Jim Pingle 8 months ago

  • Status changed from In Progress to Feedback
  • % Done changed from 0 to 100
Actions #4

Updated by Jim Pingle 8 months 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

Actions #5

Updated by Jim Pingle 8 months ago

  • Status changed from In Progress to Feedback
Actions #6

Updated by Kris Phillips 8 months 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.

Actions #7

Updated by Jim Pingle 8 months 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.

Actions #8

Updated by Jim Pingle 8 months 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.

Actions #9

Updated by Jonathan Lee 7 months ago

Thank you !

Actions #10

Updated by Jim Pingle 7 months 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.

Actions #11

Updated by Jim Pingle 6 months ago

  • Target version changed from 2.8.0 to 2.7.1
Actions

Also available in: Atom PDF