Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating EventsController.php #672

Closed
SomeAtaraxy opened this issue Jul 21, 2018 · 2 comments
Closed

Updating EventsController.php #672

SomeAtaraxy opened this issue Jul 21, 2018 · 2 comments

Comments

@SomeAtaraxy
Copy link

I followed your instructions to update the EventsController.php to the latest unreleased version in your FAQ wiki and it started causing the SQL error at the bottom of this message. The issue is that the ZM team added some code on May 7-8, 2018 and it incorrectly queries the db. Maybe change the FAQ post to point to the Dec 19 EventsController.php commit.

SQL Error:

2018-07-21 14:10:29 Error: [PDOException] SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right synta
x to use near 'fileExists' at line 1
Request URL: /api/events/93.json
Stack Trace:
#0 /usr/local/www/zoneminder/api/lib/Cake/Model/Datasource/DboSource.php(461): PDOStatement->execute(Array)
#1 /usr/local/www/zoneminder/api/lib/Cake/Model/Datasource/DboSource.php(427): DboSource->_execute('fileExists', Array)
#2 /usr/local/www/zoneminder/api/lib/Cake/Model/Datasource/DboSource.php(664): DboSource->execute('fileExists', Array, Array)
#3 /usr/local/www/zoneminder/api/lib/Cake/Model/Datasource/DboSource.php(607): DboSource->fetchAll('fileExists', Array, Array)
#4 /usr/local/www/zoneminder/api/lib/Cake/Model/Model.php(827): DboSource->query('fileExists', Array, Object(Event))
#5 /usr/local/www/zoneminder/api/app/Controller/EventsController.php(128): Model->__call('fileExists', Array)
#6 /usr/local/www/zoneminder/api/app/Controller/EventsController.php(128): Event->fileExists(Array)
#7 [internal function]: EventsController->view('93')
#8 /usr/local/www/zoneminder/api/lib/Cake/Controller/Controller.php(491): ReflectionMethod->invokeArgs(Object(EventsController), Array)
#9 /usr/local/www/zoneminder/api/app/Plugin/Crud/Lib/CrudControllerTrait.php(31): Controller->invokeAction(Object(CakeRequest))
#10 /usr/local/www/zoneminder/api/lib/Cake/Routing/Dispatcher.php(193): AppController->invokeAction(Object(CakeRequest))
#11 /usr/local/www/zoneminder/api/lib/Cake/Routing/Dispatcher.php(167): Dispatcher->_invoke(Object(EventsController), Object(CakeRequest))
#12 /usr/local/www/zoneminder/api/app/webroot/index.php(108): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#13 {main}
@pliablepixels
Copy link
Member

pliablepixels commented Jul 21, 2018

If you are referring to this FAQ entry then it is date marked 'as of Apr 2018'.

If you have updated to a version of ZM that is post Apr 2018 then you don't need to replace the file.

Edit 1: Ah I see what you mean. You are running an old version of ZM but EventsController.php has gone though changes that are messing up your system.

Yes, that may be the case.

What is the problem you are trying to solve? The 24hr preview API update required message?

Edit 2: Man I should really read the full message before. Looks like you've solved your problem and have kindly suggested I should point to the Dec 19 commit. Is that correct?

Done and thanks!

@pliablepixels
Copy link
Member

closing as I assume its resolved - please comment if something else needs attention related to this matter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants