I have a Zoneminder 1.24.1 installation on an Ubuntu 8.04 server with php 5.2.4.
Whenever I want to go to the filter window or when I click on the events in the main zoneminder screen I get following error.
For the events:
Fatal error: Cannot use string offset as an array in /var/www/includes/functions.php on line 1333
For the Filter window:
Fatal error: Cannot use string offset as an array in /var/www/skins/classic/views/filter.php on line 184
Does anyone have a clue why Zoneminder is giving this error? It worked perfectly when I installed it from source. It appears that zoneminder is recording events, I can only not view them.
Does anyone know how to fix this?
Thank You.
Filter and event screens not working
Wow that REALLY helps me (not).... Do you really think I did not lookup that error on google???cordel wrote:Try this.
The only thing I find when I search for this is the fact that there is an error in the php-code. My question was if anyone knows why ZM is giving me that error.
So if you think the answer is that easy to find, you are welcome to share it with me.
Thank you
My events list wasn't showing any events either after upgrading to 1.24.2. From the Apache error log I found the following:
In zm_html_view_events.php the SQL is built using LearnState as one of the parameters.
However this comment from zm_update-1.23.3.sql indicates the column gets dropped from database during the upgrade to 1.24.X.
If I remeove LearnState from the SQL query my events list shows up properly.
Sounds like the LearnState field shouldn't have been dropped from the database without removing references to it in the code.
Note there are other places where LearnState is referenced in the code.
Code: Select all
... Unknown column 'LearnState' in 'field list'...
However this comment from zm_update-1.23.3.sql indicates the column gets dropped from database during the upgrade to 1.24.X.
Code: Select all
--
-- Get rid of never used columnn Learn State
--
alter table Events drop column LearnState;
Sounds like the LearnState field shouldn't have been dropped from the database without removing references to it in the code.
Note there are other places where LearnState is referenced in the code.
Bluecherry PV-149 4-port capture card
Topica TP-936WIR-30C camera
Cheap Harbor Freight camera
HP Athlon 64 X2 w/ 2GB
Slackware 13 - 2.6.29.6-smp kernel
Topica TP-936WIR-30C camera
Cheap Harbor Freight camera
HP Athlon 64 X2 w/ 2GB
Slackware 13 - 2.6.29.6-smp kernel
You can disregard my previous post. The problem I had was that when I upgraded from 1.23.3 to 1.24.2 all the original web interface files from 1.23.3 remained in the web directory. I renamed the existing web directory then did a make install to copy the 1.24.2 files over again. This cured the majority of problems I was having.
Bluecherry PV-149 4-port capture card
Topica TP-936WIR-30C camera
Cheap Harbor Freight camera
HP Athlon 64 X2 w/ 2GB
Slackware 13 - 2.6.29.6-smp kernel
Topica TP-936WIR-30C camera
Cheap Harbor Freight camera
HP Athlon 64 X2 w/ 2GB
Slackware 13 - 2.6.29.6-smp kernel
non array in functions on line 1333
Hi,
Installed zoneminder 1.24.1 (ubuntu karmic server), and all goes well, except for the same error on the events window, however mine has an additional oddity : It does not happen on my laptop.
Very weird, as all the machines are all the same install of ubuntu, and that should (??) not be a worry anyways, as the pages are served from the server, so if it is working for one, it *should* work on the other machines.
I had a quick look at the code, and the function in question ' parseFilter' is supposed to be passed an array ($filter), but for some reason the var is populated with a string when the other machines call the page. The value at that time is simply 'all'.
So, somewhere this function is called with the wrong value (not an array)
A simple fix (as I do not have time to hunt down the where) is to test if $filter is not an array, and if not - re-init it to an array.
So I placed the following at line 1325:
if (!is_array($filter)){
$filter=array();
}
just above the line where the 'supposed to be an array' is adjusted. $filter['query'] = '';
It now works on all machines.
Diff below:
1325,1328d1324
< if (!is_array($filter)){
< $filter=array();
< }
<
Installed zoneminder 1.24.1 (ubuntu karmic server), and all goes well, except for the same error on the events window, however mine has an additional oddity : It does not happen on my laptop.
Very weird, as all the machines are all the same install of ubuntu, and that should (??) not be a worry anyways, as the pages are served from the server, so if it is working for one, it *should* work on the other machines.
I had a quick look at the code, and the function in question ' parseFilter' is supposed to be passed an array ($filter), but for some reason the var is populated with a string when the other machines call the page. The value at that time is simply 'all'.
So, somewhere this function is called with the wrong value (not an array)
A simple fix (as I do not have time to hunt down the where) is to test if $filter is not an array, and if not - re-init it to an array.
So I placed the following at line 1325:
if (!is_array($filter)){
$filter=array();
}
just above the line where the 'supposed to be an array' is adjusted. $filter['query'] = '';
It now works on all machines.
Diff below:
1325,1328d1324
< if (!is_array($filter)){
< $filter=array();
< }
<
-
- Posts: 10
- Joined: Mon Nov 30, 2009 9:08 pm
-
- Posts: 10
- Joined: Mon Nov 30, 2009 9:08 pm
Found the root cause of the problem for me, I'm using Transmission web interface on that same server. It sets a cookie named 'filter', which interferes with the ZM &filter url parameter.
I worked around this problem by adding
setcookie('filter', '', time() - (3600 * 25), '/', '', 0);
in index.php, right after the session_start(); call.
That works around the problem with minimum hassle.
I worked around this problem by adding
setcookie('filter', '', time() - (3600 * 25), '/', '', 0);
in index.php, right after the session_start(); call.
That works around the problem with minimum hassle.