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

Forum for questions and support relating to the 1.24.x releases only.
Locked
MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

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

Post 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.
MrEvoMan
Posts: 55
Joined: Thu Apr 23, 2009 1:25 am

Post 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.
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post 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.
Phil
User avatar
Normando
Posts: 219
Joined: Sun Aug 17, 2008 5:34 am
Location: Rosario - Argentina

Post by Normando »

Yes Phil! You are correct. Changing the line to

Code: Select all

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

Regards
Locked