Our FamilyForum

FamilyForum Documentation & Help => FamilyForum Features & Guidelines => Code & Stuff => Topic started by: Ken on September 25, 2017, 01:41:00 PM

Title: Broken Search Function!
Post by: Ken on September 25, 2017, 01:41:00 PM
We seem to be experiencing a broken search function!  :o

I'm getting this error page when trying to do a search:
Code: [Select]
Fatal error: 'continue' not in the 'loop' or 'switch' context in /home/ourfamil/public_html/FamilyForum/Sources/SearchAPI-Custom.php on line 112
Title: Re: Broken Search Function!
Post by: Skhilled on September 26, 2017, 07:47:53 AM
Yes, thought I had mentioned that before... I'm not sure what's going on with that. It's either PHP7 (but it's not doing it on my sites) or some kind of conflict somewhere...
Title: Re: Broken Search Function!
Post by: Ken on September 26, 2017, 08:08:29 AM
You might have mentioned it before... but me disremembers.  :o
Title: Re: Broken Search Function!
Post by: Skhilled on September 26, 2017, 08:40:29 AM
I just checked your file against my file and that section is exactly the same. So, something else may be causing it somehow...
Title: Re: Broken Search Function!
Post by: Ken on September 26, 2017, 05:21:07 PM
While doing some maintenance in the Media Gallery dashboard I'm getting this error when doing the "Rebuild Item Thumbnails" function... just wondering if this is tied to the other error posted above?
Title: Re: Broken Search Function!
Post by: Skhilled on September 27, 2017, 07:47:22 AM
That error is probably due to PHP7...
Title: Re: Broken Search Function!
Post by: Mick on October 03, 2017, 01:36:45 PM
Try this,

Open Sources/SearchAPI-Custom.php
Find
Code: [Select]
// Excluded phrases don't benefit from being split into subwords.
if (count($subwords) > 1 && $isExcluded)
continue;
Change to
Code: [Select]
// Excluded phrases don't benefit from being split into subwords.
if (count($subwords) > 1 && $isExcluded)
return;
Title: Re: Broken Search Function!
Post by: Ken on October 03, 2017, 02:56:57 PM
All right Mick!!!  :thumbup:

That works.  laughing7

Title: Re: Broken Search Function!
Post by: Mick on October 03, 2017, 04:10:17 PM
Cool, that's good to know.   :thumbup:

Just in case you think I've suddenly developed coding skills, I can assure you I haven't lol..  I found the answer here, https://www.simplemachines.org/community/index.php?topic=553979.0
Title: Re: Broken Search Function!
Post by: Ken on October 03, 2017, 09:22:55 PM
You could have remained mum and I would have never known.  laughing7
Title: Re: Broken Search Function!
Post by: Skhilled on October 04, 2017, 08:30:01 AM
Mick, The Super Code Searcher...