Buttons do not work

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Buttons do not work

Post by sabretoothedhamster » Mon Feb 10, 2020 6:41 pm

Hello again!

After solving the initial issue with missing db updates I tried to check everything else and found exactly the same trouble as I did while trying to test v1.33: viewtopic.php?f=39&t=28243&p=110271

Most of the buttons do not function at all. E.g. on en event detail page only the 'Download MP4' button (which is actually a plain link) works. The drop-down selectors (Replay/Scale/Codec) do not work as well. And like in the above mentioned case I am able to call the respective functions (e.g. showEventFrames() or showStream() or showStills()) manuall from the developer's console and those functions work as expected.

Tried Chromium/FF. No resource load or js execution errors.

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Buttons do not work

Post by bbunge » Mon Feb 10, 2020 7:11 pm

You did not say where the buttons were that did not work. Assuming you meant the buttons in an event view, I did a test with my production server, Bionic with ZM 1.34.2 viewing an event. All the buttons worked for me, rename to export.
You may want to check the zm database for correct permissions
mysql -uroot -p -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Mon Feb 10, 2020 9:40 pm

Thanks for your idea, bbunge but it did not help :( It seems to me that something is wrong with page code (either html or js). Unfortunately I am not so experienced in web coding to find the reason myself.

I have found only one working button so far: at the top-right corner of the main page ('running' / 'stopped'). It looks like

Code: Select all

<button type="button" class="btn btn-default navbar-btn" data-toggle="modal" data-target="#modalState">Running</button>
while every other button

Code: Select all

<button type="button" name="addBtn" data-on-click-this="addMonitor">
or

Code: Select all

<button type="button" data-on-click="showEventFrames">
or

Code: Select all

<button type="button" data-on-click-this="addTerm">
does not produce any action.

Apparently buttons with data-on-click* doe not work somehow...

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

Re: Buttons do not work

Post by iconnor » Mon Feb 10, 2020 10:35 pm

There is javascript code that runs on every page load that goes through all the buttons and connects their actions.
This is obviously not running.

ou will have to check to the javascript console to see why.

Right click --> Inspect Elemen t -> Console

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Mon Feb 10, 2020 11:49 pm

Isaac, your approach gave the following outcome (I have inspected 'Frames' button on the event details page):

Code: Select all

The Content Security Policy 'script-src 'unsafe-inline' 'self' 'nonce-df5875716370a9dcb1e200eab6c75b2c' ;' was delivered in report-only mode, but does not specify a 'report-uri'; the policy will have no effect. Please either add a 'report-uri' directive, or deliver the policy via the 'Content-Security-Policy' header.
videojs.zoomrotate.js:1 zoomrotate: Start
videojs.zoomrotate.js:5 zoomrotate: Init defaults
videojs.zoomrotate.js:10 zoomrotate: Init Extend
videojs.zoomrotate.js:72 zoomrotate: End
74[Violation] Added non-passive event listener to a scroll-blocking <some> event. Consider marking event handler as 'passive' to make the page more responsive. See <URL>
videojs.zoomrotate.js:34 zoomrotate: Register init
videojs.zoomrotate.js:43 zoomrotate: [object CSSStyleDeclaration]
videojs.zoomrotate.js:44 zoomrotate: [object CSSStyleDeclaration]
videojs.zoomrotate.js:45 zoomrotate: undefined
videojs.zoomrotate.js:46 zoomrotate: 1
videojs.zoomrotate.js:68 zoomrotate: Register end
skins_classic_views_js_event-base-1580858142.js:59 No cue frames for event
video.js:1645 XHR finished loading: GET "data:plain/text;charset=utf-8,"WEBVTT\n\n 00:00:00.000 --> 00:00:01.000 ZoneMinder"".
vjs.xhr @ video.js:1645
vjs.TextTrack.load @ video.js:8199
vjs.TextTrack.activate @ video.js:8149
vjs.TextTrack.show @ video.js:8104
vjs.Player.showTextTrack @ video.js:7875
(anonymous) @ video.js:7838
ret @ video.js:868
setTimeout (async)
vjs.Component.setTimeout @ video.js:2849
(anonymous) @ video.js:7837
vjs.Component.ready @ video.js:2459
vjs.Player.addTextTrack @ video.js:7836
vjs.Player.addTextTracks @ video.js:7857
init @ video.js:8489
subObj @ video.js:250
vjs.Component.addChild @ video.js:2070
handleAdd @ video.js:2192
vjs.obj.each @ video.js:754
vjs.Component.initChildren @ video.js:2213
init @ video.js:1756
subObj @ video.js:250
init @ video.js:3671
subObj @ video.js:250
vjs @ video.js:59
initPage @ skins_classic_views_js_event-base-1580858142.js:998
(anonymous) @ mootools-core.js:1
(anonymous) @ mootools-core.js:1
each @ mootools-core.js:1
fireEvent @ mootools-core.js:1
g @ mootools-core.js:1
71XHR finished loading: GET "<URL>".
skins_classic_js_skin-base-1580858142.js:198 Request Failed: timeout, timeout
jquery.js:9664 XHR failed loading: GET "http://myhost/zm/index.php?view=request&request=status&entity=navBar".
send @ jquery.js:9664
ajax @ jquery.js:9215
jQuery.<computed> @ jquery.js:9361
getJSON @ jquery.js:9344
getNavBar @ skins_classic_js_skin-base-1580858142.js:195
setInterval (async)
(anonymous) @ skins_classic_js_skin-base-1580858142.js:190
fire @ jquery.js:3148
fireWith @ jquery.js:3260
ready @ jquery.js:3472
completed @ jquery.js:3503
skins_classic_js_skin-base-1580858142.js:198 Request Failed: timeout, timeout
jquery.js:9664 XHR failed loading: GET "http://myhost/zm/index.php?view=request&request=status&entity=navBar".
send @ jquery.js:9664
ajax @ jquery.js:9215
jQuery.<computed> @ jquery.js:9361
getJSON @ jquery.js:9344
getNavBar @ skins_classic_js_skin-base-1580858142.js:195
setInterval (async)
(anonymous) @ skins_classic_js_skin-base-1580858142.js:190
fire @ jquery.js:3148
fireWith @ jquery.js:3260
ready @ jquery.js:3472
completed @ jquery.js:3503
skins_classic_js_skin-base-1580858142.js:198 Request Failed: timeout, timeout
jquery.js:9664 XHR failed loading: GET "http://myhost/zm/index.php?view=request&request=status&entity=navBar".
send @ jquery.js:9664
ajax @ jquery.js:9215
jQuery.<computed> @ jquery.js:9361
getJSON @ jquery.js:9344
getNavBar @ skins_classic_js_skin-base-1580858142.js:195
setInterval (async)
(anonymous) @ skins_classic_js_skin-base-1580858142.js:190
fire @ jquery.js:3148
fireWith @ jquery.js:3260
ready @ jquery.js:3472
completed @ jquery.js:3503
skins_classic_js_skin-base-1580858142.js:198 Request Failed: timeout, timeout
jquery.js:9664 XHR failed loading: GET "http://myhost/zm/index.php?view=request&request=status&entity=navBar".
send @ jquery.js:9664
ajax @ jquery.js:9215
jQuery.<computed> @ jquery.js:9361
getJSON @ jquery.js:9344
getNavBar @ skins_classic_js_skin-base-1580858142.js:195
setInterval (async)
(anonymous) @ skins_classic_js_skin-base-1580858142.js:190
fire @ jquery.js:3148
fireWith @ jquery.js:3260
ready @ jquery.js:3472
completed @ jquery.js:3503

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

Re: Buttons do not work

Post by iconnor » Tue Feb 11, 2020 1:39 am

You've got timeouts loading the javascript and other files... something seriously not ok with your system.

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Tue Feb 11, 2020 10:03 am

Please, point me out which "other files" do you mean? As far as I understand the only noticeable error in the log above is

Code: Select all

XHR failed loading: GET "http://myhost/zm/index.php?view=request&request=status&entity=navBar"
and it is just a timely status update. It could fails sometimes because the system is monitored over rather weak LTE connection... However the effect of non-working buttons persists over all the pages and all the time no matter how good the link at particular time interval.

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Tue Feb 11, 2020 1:07 pm

One more detail: I have checked apache logs and found that every single request to /zm* finishes with code 200 (i.e. no unresolved resources are asking from browser side)

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Wed Feb 12, 2020 3:29 pm

It seems that no one has any other ideas regarding this case. May there be some checks that I could perform to find the reason of such a trouble?

I have found so far, that button-linked event processing logic had been changed after 1.32 (then it was plain standard onclick event attribute

Code: Select all

<button type="button" onclick="showEventFrames()">
while now it uses some custom data-on-click

Code: Select all

<button type="button" data-on-click="showEventFrames">
which apparently does not work as it was supposed to...

bbunge
Posts: 2698
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: Buttons do not work

Post by bbunge » Thu Feb 13, 2020 12:53 am

Well, you may be due for an OS reinstall as it seems that something is missing from sometime back. I considered recommending a forced reinstall of the LAMP and Zoneminder but is is questionable that the messed up config files, whichever they are, would be overwritten. If you have an old PC or can set up a VM with Linux practice on that before you wipe your operating server. Usually you can do a dump of the zm database and reuse it in the new install. But in your case it may be best to start with a fresh everything.
Or you can bone up on javascript errors...

sabretoothedhamster
Posts: 23
Joined: Fri Mar 22, 2019 1:21 pm

Re: Buttons do not work

Post by sabretoothedhamster » Fri Mar 20, 2020 10:10 am

For those with similar mysterious troubles: my final solution was a clean reinstall of zm (i.e. I have uninstalled zm, manually checked and removed all the remaining files/data (configs, db etc.) and installed fresh zm 1.34 (my previous install was 1.32 updated to 1.34).
After that (and after total browser's cache cleanup) zm started to work as expected.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 6 guests