ZenPhoto - 1.4.2 [8956] - Garland theme.
I'm getting this error when I search the site...
http://content.screencast.com/users/n20capri/folders/Default/media/981a5683-9ced-432b-aae4-b4521a6f1378/searcherror.JPG
BUT, I only get it when I search for something ("butter" for example) on a category page (Chicken, Beef, Pasta etc.) or a or sub-category page (Sides/Potatoes, Salads) If I search for butter on the home page - it returns 4 results. If I search for butter on the All Recipes page (formerly All news) it returns 4 results. If I search for butter on the actual recipe page (news article page) it returns 4 results. Even searching for butter on the search page works fine. Searching for butter on the album index page works too but it doesn't return any results...I guess because there are no images yet. Archive view and contact us work fine too...
http://recipes.mikemartinelli.com/
I have slightly modified the theme with the word "recipe" to replace the word "news" in a few spots but it has the same error with the out of the box Garland theme. The search word doesn't matter - I just used butter as an example. Install and setup went smooth as usual...never had this issue before and I've done a ton of ZenPhoto installs/sites.
Any insight on this issue?
Thanks,
Mike
{Wed, 18 Jan 2012 17:35:22 GMT} Zenphoto v1.4.2[8956]
Backtrace: fatal zp_error:MySQL Query ( SELECT DISTINCT `news_id` FROM `_news2cat` WHERE ) failed. MySQL returned the error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
zp_error called
from query (functions-db-MySQL.php [74])
from query_full_array (functions-db-MySQL.php [107])
from SearchEngine->subsetNewsCategories (class-search.php [679])
from SearchEngine->searchFieldsAndTags (class-search.php [1033])
from SearchEngine->getSearchNews (class-search.php [1482])
from getNumNews (zenpage-template-functions.php [204])
from include (search.php [36])
from index.php [128]
What do you mean defined exactly? I have 10 categories - they are all down the left...
And as seen on the backend...
Not really much else to see - yes all are published and non are protected...
Interesting...I was getting it to error on those pages every time but that's because I was searching for words I knew it would find...butter for example. Or Flour or Chicken. However your saying it doesn't error with some words...well the words it doesn't error on aren't there.
Coke, or Cars or Ugly or Bob - they aren't anywhere in any recipe so it doesn't find them and doesn't error.
So in short, if the word is available it errors - if the word is NOT it doesn't...so it's not just "butter".
Not sure if this will help with the issue or not but it's what I just came up with! lol.
Sweet thanks!
One other thing...when I'm on the album index and search - it won't return anything on "news" or "pages" - not sure if it was meant that way or not...
I'd prefer if when searching on an album page (or any page for that matter) that it returns any page, news, album or image with that keyword...
Just a though...
Thanks again,
Mike
Quote:One other thing...when I'm on the album index and search - it won't return anything on "news" or "pages" - not sure if it was meant that way or not
This was deliberate. The search is "context sensitive". If on a specific album page it will search only that album.
You can change this if you want--be sure you do it in a copy of the theme. All this is setup in the beginning of the sidebar.php script.