Firefox error console reports "controlReq is undefined"

Forum for questions and support relating to the 1.24.x releases only.
Locked
MichaelTiemann
Posts: 18
Joined: Wed Apr 20, 2011 1:04 am

Firefox error console reports "controlReq is undefined"

Post by MichaelTiemann »

It's complaining about zm/skins/classic/views/js/watch.js at line 598. I'm running a mostly-working, unmodified 1.24.3 prerelease.

There was also a complaint earlier in the file about STATE_IDLE not being defined. I forced it to be "Idle" and got rid of that error, so now the only error in the Javascript file is the one about controlReq. Any clues?

I'm hosted on RHEL6 and Firefox is running on Fedora 14.

Update 1: When I restart Firefox it reloads the Javascript and gives another error, about an undefined connKey. I force that to "", restart firefox, and then it complains about an undefined monitorId. I force that to "2" (the number of my monitor in question) and it complains about an undefined streamMode. But the streamMode complaint is after the conctrolReq, so now my monitor is under the PTZ control. Obviously something is not sharing variables between what Zoneminder thinks it should know and what watch.js is willing to admit that it knows. It is as if the whole CDATA section of my source page is being utterly ignored once I click through to the Control tab.

Update 2: It seems that when any script throws a javascript error, the whole rest of the javascript is ignored. This is why a missing or erroneous declaration in one place means that later CDATA sections are never loaded. It appears there are many defaults missing in my current install, including:

diff montage.js.php~ montage.js.php
22c22
< var SOUND_ON_ALARM = <?= ZM_WEB_SOUND_ON_ALARM ?>;
---
> var SOUND_ON_ALARM = "no"; // <?= ZM_WEB_SOUND_ON_ALARM ?>;

diff watch.js.php~ watch.js.php
75c75
< var appletRefreshTime = <?= ZM_RELOAD_CAMBOZOLA ?>;
---
> var appletRefreshTime = 300; // <?= ZM_RELOAD_CAMBOZOLA ?>;

And yet more, such as no default for COMPACT_MONTAGE, no $("alarm_sound"), and perhaps others. Need better error handling in the PHP scripts I guess!
MichaelTiemann
Posts: 18
Joined: Wed Apr 20, 2011 1:04 am

Re: "controlReq is undefined" (SOLVED)

Post by MichaelTiemann »

Replying to my own post with a fix. Ironically, I cannot post it because, as a new user, PHP code looks too much like URLs, or so says the bot.

A file is attached...except that the extension diff is not allowed. Trying .txt...which also doesn't work.

To heck with it. Send me a PM if you want a solution.
Locked