Page 1 of 1

BUG: zmpkg.pl does not enable cameras from state changes

Posted: Mon Apr 27, 2009 8:24 pm
by MrEvoMan
I wanted to create a state so that I can easily turn on all motion detection and turn off again via a command prompt.

So I went in, made my various states and set them accordingly.

The state to turn them all off worked like a champ. However, running the exact opposite state to turn them all on (different state setting) never seemed to re-enable them.

After digging through the perl code a lot, I found this was the offending snippet:

Code: Select all

$monitor->{NewEnabled} = 0 if ( !$monitor->{Enabled} );
Commenting this out fixed the problem and now the zmpkg.pl script works just as it should.

I've verified this via SQL and from the console.

Can anyone tell me what purpose that line is for anyways? I just can't seem to wrap my brain around it.

Posted: Tue May 26, 2009 6:38 pm
by MrEvoMan
Any comments on this? I find myself having to re-comment out this line all the time after upgrading versions.

Any plans to include this, or fix this? Again, it's simply due to zmpkg.pl not actually "writing" changes to states from the console to the db.

Posted: Sun Jun 28, 2009 6:58 am
by Normando

Posted: Mon Jun 29, 2009 9:40 am
by zoneminder
Only just noticed this one. Can you tell me if it works if you change the offending line to

Code: Select all

$monitor->{NewEnabled} = 0 if ( !$monitor->{NewEnabled} );
I think it should but I don't have states set up on my box at the mo.

Posted: Mon Jun 29, 2009 2:01 pm
by Normando
Yes Phil! You are correct. Changing the line to

Code: Select all

$monitor->{NewEnabled} = 0 if ( !$monitor->{NewEnabled} );
fix the issue.

Regards