How to specify a name filter?

Support and queries relating to all previous versions of ZoneMinder
Locked
User avatar
JasonH
Posts: 27
Joined: Thu Dec 16, 2004 8:33 pm
Location: Yorkshire

How to specify a name filter?

Post by JasonH »

I want to list all the events that I have renamed. I have tried:
Name does not match Event%
...and several combinations of asterisks and double / single quotes but I keep getting

Code: Select all

....window.focus(); You have an error in your SQL syntax near ')' at line 1
Any ideas greatly appreciated :)
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

Interesting. I wonder if it is JavaScript barfing on the '%'. Have you tried escaping it, e.g. Event\%?

If that still fails I'll have a proper look and fix it.

Phil
User avatar
JasonH
Posts: 27
Joined: Thu Dec 16, 2004 8:33 pm
Location: Yorkshire

Post by JasonH »

Escaping it doesn't do anything but a different error appears if you don't include any wildcards. Trying "Name matches X"

Code: Select all

function newWindow(Url,Name,Width,Height) { var Name = window.open(Url,Name,"resizable,scrollbars,width="+Width+",height="+Height); } function eventWindow(Url,Name,Width,Height) { var Name = window.open(Url,Name,"resizable,width="+Width+",height="+Height ); } function filterWindow(Url,Name) { var Name = window.open(Url,Name,"resizable,scrollbars,width=560,height=250"); } function closeWindow() { window.close(); // This is a hack. The only way to close an existing window is to try and open it! var filterWindow = window.open( "/zm/index.php?view=none", 'zmFilter', 'width=1,height=1' ); filterWindow.close(); } window.focus(); Unknown column 'X' in 'where clause'
Note, the preamble was there before but I didn't include it as I thought I'd made a newbie error :)

However, it works with numbers! Trying "Name matches 1234" brings back all events with 1234 in their name. I wonder what's going on there :?
User avatar
zoneminder
Site Admin
Posts: 5215
Joined: Wed Jul 09, 2003 2:07 pm
Location: Bristol, UK
Contact:

Post by zoneminder »

I suspect it is a quoting issue. It is happy with 1234 as numbers don't need quoting. It's probably still a bug but you could try "Name matches 'X'" making sure you put double or single quotes around your string. ZM should probably do this automatically though.

Phil
User avatar
JasonH
Posts: 27
Joined: Thu Dec 16, 2004 8:33 pm
Location: Yorkshire

Post by JasonH »

Nope, tried all the quotes and even escaped quotes.

However, I'd put this on the bottom of the list though as it's easy to use mysql to query the Event table directly.

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

Post by zoneminder »

I have been unable to reproduce this error. Can you confirm whether you are still getting it and if so perhaps I could suggest a couple of lines of diagnostics to try.

One thing I would mention is that the 'matches' and similar use full regular expressions and not the more limited sql version. So your filter could be 'matches ^Event' rather than Event%.

Phil
Locked