Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
Any search returns Fatal Error
francosolerio
New
I followed the install instructions on my 2.1 (recently upgraded from 2.0.x) installation. Any time I run a search, or if I access /forum/search I get an error:
Fatal Error in UserModel.JoinUsers(); Invalid argument supplied for foreach() The error occurred on or near: /Applications/MAMP/htdocs/techinet.it/forum/applications/dashboard/models/class.usermodel.php 704: */ 705: public function JoinUsers(&$Data, $Columns, $Options = array()) { 706: // Grab all of the user fields that need to be joined. 707: $UserIDs = array(); 708: foreach ($Data as $Row) { 709: foreach ($Columns as $ColumnName) { 710: $ID = GetValue($ColumnName, $Row); 711: if (is_numeric($ID)) 712: $UserIDs[$ID] = 1; Backtrace: [/Applications/MAMP/htdocs/techinet.it/forum/applications/dashboard/models/class.usermodel.php:708] PHP::Gdn_ErrorHandler(); [/Applications/MAMP/htdocs/techinet.it/forum/applications/dashboard/controllers/class.searchcontroller.php:99] UserModel->JoinUsers(); [/Applications/MAMP/htdocs/techinet.it/forum/applications/dashboard/controllers/class.searchcontroller.php:99] SearchController->Index(); [/Applications/MAMP/htdocs/techinet.it/forum/library/core/class.dispatcher.php:350] PHP::call_user_func_array(); [/Applications/MAMP/htdocs/techinet.it/forum/index.php:46] Gdn_Dispatcher->Dispatch(); Queries: select * from GDN_User `User` where UserID = '2'; 0.000000s select * from GDN_Permission `Permission` limit 1; 0.000000s select MAX(p.`PermissionID`) as `PermissionID`, MAX(p.`Garden.Settings.Manage`) as `Garden.Settings.Manage`, MAX(p.`Garden.Settings.View`) as `Garden.Settings.View`, MAX(p.`Garden.Messages.Manage`) as `Garden.Messages.Manage`, MAX(p.`Garden.SignIn.Allow`) as `Garden.SignIn.Allow`, MAX(p.`Garden.Applicants.Manage`) as `Garden.Applicants.Manage`, MAX(p.`Garden.Users.Add`) as `Garden.Users.Add`, MAX(p.`Garden.Users.Edit`) as `Garden.Users.Edit`, MAX(p.`Garden.Users.Delete`) as `Garden.Users.Delete`, MAX(p.`Garden.Users.Approve`) as `Garden.Users.Approve`, MAX(p.`Garden.Activity.Delete`) as `Garden.Activity.Delete`, MAX(p.`Garden.Activity.View`) as `Garden.Activity.View`, MAX(p.`Garden.Profiles.View`) as `Garden.Profiles.View`, MAX(p.`Garden.Profiles.Edit`) as `Garden.Profiles.Edit`, MAX(p.`Garden.Moderation.Manage`) as `Garden.Moderation.Manage`, MAX(p.`Garden.Curation.Manage`) as `Garden.Curation.Manage`, MAX(p.`Garden.PersonalInfo.View`) as `Garden.PersonalInfo.View`, MAX(p.`Garden.AdvancedNotifications.Allow`) as `Garden.AdvancedNotifications.Allow`, MAX(p.`Conversations.Moderation.Manage`) as `Conversations.Moderation.Manage`, MAX(p.`Vanilla.Discussions.View`) as `Vanilla.Discussions.View`, MAX(p.`Vanilla.Discussions.Add`) as `Vanilla.Discussions.Add`, MAX(p.`Vanilla.Discussions.Edit`) as `Vanilla.Discussions.Edit`, MAX(p.`Vanilla.Discussions.Announce`) as `Vanilla.Discussions.Announce`, MAX(p.`Vanilla.Discussions.Sink`) as `Vanilla.Discussions.Sink`, MAX(p.`Vanilla.Discussions.Close`) as `Vanilla.Discussions.Close`, MAX(p.`Vanilla.Discussions.Delete`) as `Vanilla.Discussions.Delete`, MAX(p.`Vanilla.Comments.Add`) as `Vanilla.Comments.Add`, MAX(p.`Vanilla.Comments.Edit`) as `Vanilla.Comments.Edit`, MAX(p.`Vanilla.Comments.Delete`) as `Vanilla.Comments.Delete`, MAX(p.`Plugins.Debugger.View`) as `Plugins.Debugger.View`, MAX(p.`Plugins.Debugger.Manage`) as `Plugins.Debugger.Manage`, MAX(p.`Garden.Email.View`) as `Garden.Email.View`, MAX(p.`Vanilla.Approval.Require`) as `Vanilla.Approval.Require`, MAX(p.`Vanilla.Comments.Me`) as `Vanilla.Comments.Me`, MAX(p.`Plugins.ProfileExtender.Add`) as `Plugins.ProfileExtender.Add`, MAX(p.`Plugins.OnlineNow.ViewHidden`) as `Plugins.OnlineNow.ViewHidden`, MAX(p.`Plugins.OnlineNow.Manage`) as `Plugins.OnlineNow.Manage`, p.JunctionTable as `JunctionTable`, p.JunctionColumn as `JunctionColumn`, p.JunctionID as `JunctionID` from GDN_Permission p join GDN_UserRole ur on p.RoleID = ur.RoleID where ur.UserID = '2' group by p.JunctionTable, p.JunctionColumn, p.JunctionID; 0.000000s select * from GDN_User `User` where UserID = '2'; 0.000000s Variables in local scope: [Data] false [Columns] array ( 0 => 'UserID', ) [Options] array ( ) [UserIDs] array ( )
0
Comments
Make sure you followed all the steps in the readme.
I honestly cannot debug this, sorry. Paging @mcu_hq
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
Do you receive this error if you disable the plugin? I don't see any reference to the sphinx plugin in that trace. The plugin does however override the default
class.searchmodel.php
, which is where I would think the problem would be if the SQL was changed between v2.0 and v2.1. I didn't see any problems with my install of 2.1, but that was a few months ago and things may have changed since then.IT seems that @peregrine has reproduced this error in the past, so somethin must be wrong in the plugin somewhere for v2.1...I'll take a look.
Ok, try this:
Open up
class.searchdmodel.php
and change line 74 to:return array();
instead ofreturn FALSE;
https://github.com/mcuhq/SphinxSearchPlugin/blob/master/class.searchmodel.php#L74
Let me know if that fixes the problem.
it happened with a beta version for me.
for me, I installed vanilla 2.1, and the latest sphinxsearch, and didn't get the problem again, without necessitating change you suggested. not sure what factors made it go away.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I did uninstall the Sphinx plugin and made a custom search plugin with searching by category and some other adjustments from standard search engine. I will mirror my installation on a developement machine and retry Sphinx with the fix you suggested in the next few days.
Thanks!
I believe I figured out the problem.
I'm pretty sure this is the issue. @francosolerio @mcu_hq
I can cause error by adding $Configuration['Debug'] = TRUE; to config.php
and if I remove debug statement sphinx works fine.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I also see this on my production site. Enabling debug via conf will throw errors on many pages in 2.1. Goes away when removing debug mode.
Search first
Check out the Documentation! We are always looking for new content and pull requests.
Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.
another side issue if you have eventi plugin enabled, you won't be able to enable plugins via dashbpard either.
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
@mcu_hq with your change
works perfectly with NO ERRORS
$Configuration['Debug'] = TRUE; in your config.php
or
$Configuration['Debug'] = FALSE; in your config.php
I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.
I can confirm that $Configuration['Debug'] = FALSE; solves the issue here.
Returning array() instead of FALSE in class.searchdmodel.php line 74 gives a different error on my installation (see below). This error like the previous one disappears with Configuration['Debug'] = FALSE;