opennetadmin / ona

OpenNetAdmin IP Address Management (IPAM) system
opennetadmin.com
GNU General Public License v2.0
136 stars 34 forks source link

dcm.pl throws error when getting empty custom_attribute_display list #176

Closed heppel closed 11 months ago

heppel commented 12 months ago

dcm.pl version 1.24 on Debian 12 / PHP 8.2.7 produces this error on the web server

[Fri Jul 07 09:42:46.635634 2023] [php:error] [pid 53240] [client 10.3.1.9:45104] PHP Fatal error: Uncaught TypeError: array_keys(): Argument #1 ($array) must be of type array, null given in /opt/ona/www/include/functions_general.inc.php:1770\nStack trace:\n#0 /opt/ona/www/include/functions_general.inc.php(1770): array_keys()\n#1 /opt/ona/www/modules/ona/custom_attribute.inc.php(737): format_array()\n#2 /opt/ona/www/include/functions_general.inc.php(1546): custom_attribute_display()\n#3 /opt/ona/www/dcm.php(84): run_module()\n#4 {main}\n thrown in /opt/ona/www/include/functions_general.inc.php on line 1770

when called like this: /opt/ona/bin/dcm.pl -r custom_attribute_display subnet=10.1.6.0 where the subnet does not have any custom attributes.

The server is on the the same OS/PHP versions with Apache/2.4.57. ONA is version v19.0.1.

Thank you very much for providing ONA.