error with presets

Support and queries relating to all previous versions of ZoneMinder
Locked
breizhbug
Posts: 61
Joined: Wed May 10, 2006 10:59 am
Location: France

error with presets

Post by breizhbug »

Hello,
When I use presets to set up a new monitor, after choosing camera, I have this error message Unknown column 'DefaultView' in 'field list'

May be someone could help me ?
Pascal
User avatar
ammaross
Posts: 61
Joined: Mon Mar 12, 2007 8:34 pm
Location: Utah, USA

Monitor Presets Fix

Post by ammaross »

I did some checking on your error and found out that my ZoneMinder does it as well. So, why not fix it? Here's the fix:

Code: Select all

	$new_x10_monitor = isset($x10_monitor)?$x10_monitor:array();
}
if ( !empty($preset) )
{
-	$result = mysql_query( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" );
+	$result = mysql_query( "select Type, Device, Channel, Format, Host, Port, Path, Width, Height, Palette, MaxFPS, Controllable, ControlId, ControlDevice, ControlAddress, " /*DefaultView,*/ . "DefaultRate, DefaultScale from MonitorPresets where Id = '$preset'" );
	if ( !$result )
		die( mysql_error() );
	$preset = mysql_fetch_assoc( $result );
	mysql_free_result( $result );
Why does this work? The select statement in the changed line above asked for a DefaultView column from the MonitorPresets table. There is no DefaultView column in that table, so, just don't ask for it.

ZM, was this just a bit of legacy code or something important? :roll:

I tested this fix on my copy and works 100%.
breizhbug
Posts: 61
Joined: Wed May 10, 2006 10:59 am
Location: France

Post by breizhbug »

:oups: Sorry, I didn't try to search before posting...
OK, issue closed
User avatar
ammaross
Posts: 61
Joined: Mon Mar 12, 2007 8:34 pm
Location: Utah, USA

Post by ammaross »

:oops: Sorry, I didn't try to search before posting...
No worries, I didn't check the wiki either. :wink:
breizhbug
Posts: 61
Joined: Wed May 10, 2006 10:59 am
Location: France

Post by breizhbug »

I've tried to patch 1.22.3 with monitor presets patch found in wiki.
Patch applied on file zm_html_view_monitor.php in /usr/local/zcr/ZoneMinder-1.22.3 (/web)

Error still the same.

Do I need to compile again or not.
Excuse if my question seems stupid but I have still some gap with linux architecture
Thanks
User avatar
ammaross
Posts: 61
Joined: Mon Mar 12, 2007 8:34 pm
Location: Utah, USA

Post by ammaross »

breizhbug wrote:I've tried to patch 1.22.3 with monitor presets patch found in wiki.
Patch applied on file zm_html_view_monitor.php in /usr/local/zcr/ZoneMinder-1.22.3 (/web)

Error still the same.
One of two things, either your apache is using a location other than /web for its files, or the patch was not successful. Check your /web dir for a patch reject file, or just open the zm_html_view_monitor.php and use my first posting to verify the line was modified properly. (the - is the old line and + is the new line). If it was applied properly, and apache does use /web for its web files, try closing the webpage and trying again.
breizhbug wrote: Do I need to compile again or not.
Excuse if my question seems stupid but I have still some gap with linux architecture
Thanks
No need ot recompile. We are not changing any source code, just PHP scripts.
breizhbug
Posts: 61
Joined: Wed May 10, 2006 10:59 am
Location: France

Post by breizhbug »

Hi,

I check, patch is really applied. I verified into zm_html_view_monitor.php.
So apache is using same file in another directory
I will check with locate and modify.
Thanks
User avatar
cordel
Posts: 5210
Joined: Fri Mar 05, 2004 4:47 pm
Location: /USA/Washington/Seattle

Post by cordel »

The file that needs to be patched is the one that is installed and not your source file. You can copy the patched file to the installed location and it will work fine in this case as php files don't get compiled and is an interpreted language.
Locked