Description
The SLA page (/slas) only displayed menu bar.
In the PHP log, we can see this error :
PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /opt/observium/21.12.11808/html/pages/slas.inc.php:146\nStack trace:\n#0 /opt/observium/21.12.11808/html/pages/slas.inc.php(146): in_array()\n#1 /opt/observium/21.12.11808/html/index.php(271): include('...')\n#2 {main}\n thrown in /opt/observium/21.12.11808/html/pages/slas.inc.php on line 146' |
I thiking it's related to PHP 8.0.
I solved the problem with this code modification line 146:
- if ($owner == $vars['owner'] || in_array($owner, $vars['owner']) ) |
+ if ($owner == $vars['owner'] || (!safe_empty($vars['owner']) && in_array($owner, $vars['owner'])) ) |
I don't know if this is the official method for Observium, but it works
Attachments
Activity
Status | Original: Resolved [ 5 ] | New: Closed [ 6 ] |
Labels | Original: SLA web | New: SLA php8 web |
Resolution | New: Fixed [ 1 ] | |
Status | Original: In Progress [ 3 ] | New: Resolved [ 5 ] |
Status | Original: In Review [ 10101 ] | New: In Progress [ 3 ] |
Status | Original: Pending Response [ 10000 ] | New: In Review [ 10101 ] |
Component/s | New: Default [ 10900 ] |
Assignee | Original: Adam Armstrong [ adama ] | New: Mike Stupalov [ landy ] |
Status | Original: Open [ 1 ] | New: Pending Response [ 10000 ] |
Fixed in r11819.