Page 1 of 1

V1.29 Upgrade - control_functions.php

Posted: Wed May 18, 2016 2:12 pm
by SpyderG
Hi,
I recently upgrade zoneminder from v1.28 to v1.29, and since then the ‘Control’ link on the montage display (classic skin) has failed to show the pan/tilt controls, presets etc.
I had a quick look, and it seems as though the monitor data is passed to function getControlCommands in includes/control_functions.php as an array ($monitor), but is interrogate as an object.

Putting back the v1.28 version of control_functions.php and re-enabling short_open_tag in zoneminder.conf displays the controls as expected.

I read the upgrade notes, but couldn’t see anything relevant…. Have I missed something ?

Thanks
Spyder

Centos 6.4
Php 5.3.3

Re: V1.29 Upgrade - control_functions.php

Posted: Wed May 18, 2016 2:50 pm
by knight-of-ni
How did you upgrade from 1.28 to 1.29? Are you using zmrepo, did you build from-source, something else?

Why did you re-enable php short tags? Did you see a short tag in the php source? It's possible we missed one.
Does the control link on the monitor window, instead of montage, work?

We need to see your log files when the problem is occurring.
Since this is with the frontend, you should also open the debug console in your web browser and see if there is anything unusual there.

Re: V1.29 Upgrade - control_functions.php

Posted: Thu May 19, 2016 12:52 pm
by SpyderG
Hi,
thanks for the response.
The upgrade was from the zmrepo.
I re-enable short tags as there were some in the v1.28 control_functions.php which I put back.
The controls on the watch view work fine, it's only from the montage.
The page throws a 500 Internal Server Error.

log:
[Thu May 19 13:26:13 2016] [error] [client 192.168.1.92] PHP Notice: Undefined index: mid in /usr/share/zoneminder/www/skins/classic/views/control.php on line 33, referer: http://192.168.1.222/zm/index.php
[Thu May 19 13:26:13 2016] [error] [client 192.168.1.92] PHP Fatal error: Call to a member function CanFocus() on a non-object in /usr/share/zoneminder/www/skins/classic/includes/control_functions.php on line 362, referer: http://192.168.1.222/zm/index.php

I tried the same on php versions 5.4, 5.5 and 5.6 to see if it was a change to php objects, but still didn't work.

By changing the 1.29 version of control_functions to cast the $monitor array as an object in ptzControls and removing the open/close brackets from object variables it works fine. e.g changed... if ( $monitor->CanZoomCon() ) to if ( $monitor->CanZoomCon ).

Must admit I don't tend to use php objects, but hopefully the above will help a little.

Thanks
Spyder