ganglia / ganglia-web

Ganglia Web Frontend
BSD 3-Clause "New" or "Revised" License
317 stars 169 forks source link

Add default arguments so decompose works on php7.1 #344

Closed cddude229 closed 4 years ago

cddude229 commented 5 years ago

PHP 7.1 introduces a fatal error when you call a method with not enough arguments (https://www.php.net/manual/en/migration71.incompatible.php)

Sample error you'd see:

PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function build_aggregate_graph_config(), 4 passed in /home/ganglia-webfrontend/decompose_graph.php on line 40 and exactly 6 expected in /home/ganglia-webfrontend/functions.php:1156

Based off decompose's usage, these arguments were always intended to be optional (especially since we run isset() later), thus I recommend making them optional.