We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Forum - Search function displays 500 Internal Server error | Forum

Hennesen
Hennesen Jul 10

Hello everyone,


I am running a website with Oxwall and all is fine except for the search function (Standard Forum Module). When someone uses the search function, the page displays the following error:








Error details: Type: Exception Message: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'rows' at line 23 File: /home/npccneta/public_html/portal/ow_core/database.php Line: 723 Trace: #0 /home/npccneta/public_html/portal/ow_core/database.php(723): PDOStatement->execute() #1 /home/npccneta/public_html/portal/ow_core/database.php(385): OW_Database->execute('\r\n S...', Array) #2 /home/npccneta/public_html/portal/ow_system_plugins/base/bol/search_entity_dao.php(387): OW_Database->queryForRow('\r\n S...', Array) #3 /home/npccneta/public_html/portal/ow_system_plugins/base/classes/mysql_search_storage.php(277): BOL_SearchEntityDao->findEntitiesCountByText('photos', Array, 0, 0) #4 /home/npccneta/public_html/portal/ow_core/text_search_manager.php(303): BASE_CLASS_MysqlSearchStorage->searchEntitiesCount('photos', Array, 0, 0) #5 /home/npccneta/public_html/portal/ow_plugins/forum/bol/text_search_service.php(285): OW_TextSearchManager->searchEntitiesCount('photos', Array) #6 /home/npccneta/public_html/portal/ow_plugins/forum/bol/forum_service.php(1924): FORUM_BOL_TextSearchService->countGlobalTopics('photos', NULL) #7 /home/npccneta/public_html/portal/ow_plugins/forum/controllers/search.php(472): FORUM_BOL_ForumService->countGlobalTopics('photos', NULL) #8 /home/npccneta/public_html/portal/ow_plugins/forum/controllers/search.php(66): FORUM_CTRL_Search->searchEntities(Array, 'global') #9 [internal function]: FORUM_CTRL_Search->inForums(Array) #10 /home/npccneta/public_html/portal/ow_core/request_handler.php(250): ReflectionMethod->invokeArgs(Object(FORUM_CTRL_Search), Array) #11 /home/npccneta/public_html/portal/ow_core/request_handler.php(226): OW_RequestHandler->processControllerAction(Object(ReflectionMethod), Object(FORUM_CTRL_Search)) #12 /home/npccneta/public_html/portal/ow_core/application.php(346): OW_RequestHandler->dispatch() #13 /home/npccneta/public_html/portal/index.php(76): OW_Application->handleRequest() #14 {main}


I am running a couple of other websites with Oxwall and never experienced this problem. Grateful for any suggestions people might have.


Thank you.

Jamie
Jamie Jul 10
Enable Dev mode and screenshot the page then with more information
Hennesen
Hennesen Jul 10
Thanks for your quick reply. Please see the attached screenshot.
Attachments:
  debug.PNG (59Kb)
Jamie
Jamie Jul 11
So looks like it's a SQL error in the Forum plugin?


Can't say more than that. Someone else should be able to solve the error itself 

Patricia Zorrilla Bcn

Edit the ow_system_plugins / base / bol / search_entity_dao.php file

on line 415 insert the code that I show in the image

Put the web in DEBUG mode https://wiki.oxwall.com/plugin-tuts:enable-debug

Reproduce the problem and take a screenshot.

Undo the changes in the file

Enter the web to register the changes in this file

Turn off the DEBUG mode

Put us here the screenshot, to see if we can help you


Hennesen
Hennesen Jul 11

Hi,


Thanks for your reply. I followed your instructions and got the following message (see screenshot).


Thanks again for your help.

Attachments:
  Error_Message_2.PNG (18Kb)
Patricia Zorrilla Bcn

It is a complex sql query that searches based on what other tables return.

It is not a code error but there is some record in an incorrect table.

You would have to access the database to execute these queries individually and note that each one returns to find the problem.

Maybe other people can think of other methods to solve this without deleting contents of the forum, but without being able to access the database I can not think of how to do it.


Hennesen
Hennesen Jul 15

Hi Patricia,


Thanks for your response. Ok, I'll give it a go, database stuff is not my stronghold unfortunately but I'll see how I go. Any other hints and tricks more than welcome. Thanks.