pnp4nagios
pnp4nagios copied to clipboard
sizeof(): Parameter must be an array or an object that implements Countable
application/models/data.php [979]:
Ubuntu 18.04 php 7.2
solution: change if(sizeof($pages) > 0 ){ to if(is_arrary($pages) && sizeof($pages) > 0 ){
This works to fix the error in PHP 7.2
Thanks for the fix and especially the comment :) where is the donate button?
there is a typo "arrary" in the fix.
that's an eagle eye :) I didn't catch it until now but the pnp graphs worked anyway for some reason..
There is another if(sizeof($pages)>0){ in getPages() function but I only changed the one in getFirstPage()
Make sure to use the correct spelling of array :)
application/models/data.php [979]: Ubuntu 18.04 php 7.2
solution: change if(sizeof($pages) > 0 ){ to if(is_array($pages) && sizeof($pages) > 0 ){
Thank you very much for the fix!
Fixing it with sed:
sed -i 's:if(sizeof(\$pages:if(is_array(\$pages) \&\& sizeof(\$pages:' /usr/local/pnp4nagios/share/application/models/data.php
I believe this issue was solved with PR #141.
Hi , where did you make that changue, in what configuration file?
application/models/data.php
It is today. So 2020, and I needed to apply this to work on 0.6 with php newest on archlinux.
Is package distribution just messed up...should everyone be using git?
Why are there no git releases? And this seems like something important for 0.6? so why not release 0.7?
if this issue is closed I would be going crazy right now.
THANKS FOR WORKING ON THIS.
Are source forge releases dead?
I have the same issue. I run sed -i 's:if(sizeof($pages:if(is_array($pages) && sizeof($pages:' /usr/local/pnp4nagios/share/application/models/data.php
The graphs are shown, but have error

Somebody have fix about this case? The error is
Fatal error: Method View::__toString() must not throw an exception, caught Error: Call to undefined function is_arrary() in /usr/local/pnp4nagios/share/application/views/graph.php on line 0
Somewhere you have misspelled "is_array" as "is_arrary"
D/\N
Thanks - that's was the issue.
Was this issue fixed with d5e04540d52238dfcb877d7116316ba1be8c1963 ?