ZenphotoCMS Forum
Garland Search Error? - Printable Version

+- ZenphotoCMS Forum (https://forum.zenphoto.org)
+-- Forum: Support (https://forum.zenphoto.org/forum-1.html)
+--- Forum: General support (https://forum.zenphoto.org/forum-4.html)
+--- Thread: Garland Search Error? (/thread-9504.html)



Garland Search Error? - n20capri - 2012-01-18

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




Garland Search Error? - acrylian - 2012-01-18

I see it on your site but I could not reproduce an error on a quick local test. In short I have no idea...




Garland Search Error? - sbillard - 2012-01-18

If you will change the DEBUG_ERROR error define in global-definitions.php to true and re-run the test there will be a stack trace along with the message. This will help us diagnose the issue.




Garland Search Error? - n20capri - 2012-01-18

{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]



Garland Search Error? - sbillard - 2012-01-19

Do you have any categories defined? If not, make one. I think that is the source of the problem.

Please let us know the answer.




Garland Search Error? - n20capri - 2012-01-19

What do you mean defined exactly? I have 10 categories - they are all down the left...

And as seen on the backend...

http://content.screencast.com/users/n20capri/folders/Default/media/9cebce2b-f09f-45cf-a7ce-4395d6598ee6/Cats.JPG




Garland Search Error? - sbillard - 2012-01-19

Probably should have shown the whole image--are these categories published? protected?




Garland Search Error? - n20capri - 2012-01-20

Not really much else to see - yes all are published and non are protected...

http://content.screencast.com/users/n20capri/folders/Default/media/12ba5f38-1b77-4e07-a77a-03b096be7364/cat2.JPG




Garland Search Error? - acrylian - 2012-01-20

Somehow some words work and some like "Butter" cause this error on your site. So what is wrong with "butter" then... I am sorry, I have no idea what may cause this. Hopefully sbilliard will have any idea later...




Garland Search Error? - n20capri - 2012-01-20

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.




Garland Search Error? - sbillard - 2012-01-20

Ah, enough information to reproduce the error. Fixed in tonight's build.




Garland Search Error? - n20capri - 2012-01-20

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




Garland Search Error? - n20capri - 2012-01-20

Also, how do I get tonight's build? I've never done it before.
Thanks




Garland Search Error? - fretzl - 2012-01-20

http://www.zenphoto.org/pages/nightly-builds (scroll down a bit)
Choose the [i]trunk[/i] version (not the [i]development[/i])

You will have to wait until the latest nightly is generated.
(each day at 11 PM Pacific Standard Time)




Garland Search Error? - sbillard - 2012-01-21

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.




Garland Search Error? - n20capri - 2012-01-21

Cool thanks guys! Works great.