Unsupported operand types error

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
lennyg
Posts: 6
Joined: Sat Dec 19, 2020 10:04 pm

Unsupported operand types error

Post by lennyg »

I just upgraded to 1.36.31 from 1.34. When I do:

http://localhost/zm/api/monitors/alarm/ ... nd:on.json

I'm getting:

"Unsupported operand types: string - int"

This was working on the old version. Any thoughts on what's going wrong?
Thanks
User avatar
iconnor
Posts: 3276
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Unsupported operand types error

Post by iconnor »

Post the actual log, we need to know which line is generating that error.

Did you ONLY upgrade zoneminder? That looks more like a complaint from a newer php to me.
lennyg
Posts: 6
Joined: Sat Dec 19, 2020 10:04 pm

Re: Unsupported operand types error

Post by lennyg »

You’re absolutely right. I actually got a new computer, with a whole new installation of Ubuntu.

Which log file should I be looking at? I looked around and couldn’t find anything relevant.

Thanks
User avatar
iconnor
Posts: 3276
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Unsupported operand types error

Post by iconnor »

Found it.

Line 303 of /usr/share/zoneminder/www/api/app/Controller/MonitorsController.php needs to be:

$status = intval($status) - 1;
lennyg
Posts: 6
Joined: Sat Dec 19, 2020 10:04 pm

Re: Unsupported operand types error

Post by lennyg »

That did the trick. Thanks for your help and your quick reply (especially considering I didn't give you much info).
Post Reply