Search functions gives Database_Exception [ Database Error ]
DiegoS
Joined: 2012-01-16
Posts: 20 |
![]() |
Hello I'm experiencing a proble that looks very similar as post I'll try to explain what happens. When search for a keyword that is common in more than than two items ( can be in the photo name, description or tag field) the result of the search shows the thumbnail of the photo , but when clicked on the thumbnail an error page opens ( at the and of the post you will find it). Please note if on the sidebar the block popular tag is active and if clicked on a specific tag that is present on multiple photos everything works fine. It looks like that the search modules could be the cause. DiegoS ----------------------------------------------------
We tried really hard, but it's broken. Hey wait, you're an admin! We can tell you stuff. There's an error message below and you can find more details in gallery3/var/logs (look for the file with the most recent date on it). Stuck? Stop by the Gallery 3 Forums and ask for help. You can also look at our list of open tickets to see if the problem you're seeing has been reported. If you post a request, here's some useful information to include: Platform information Host name: localhost Version: 3.0.5 (Daydreaming) 22 } SYSPATH/libraries/Database.php[ 272 ] » Database_Mysqli_Core->query_execute( arguments ) MODPATH/gallery/libraries/MY_Database.php[ 48 ] » Database_Core->query( arguments ) MODPATH/search/helpers/search.php[ 156 ] » Database->query( arguments ) MODPATH/search/controllers/search.php[ 83 ] » search_Core::get_position_within_album( arguments ) {PHP internal call} » Search_Controller::get_display_context( arguments ) MODPATH/gallery/helpers/item.php[ 419 ] » call_user_func_array( arguments ) MODPATH/gallery/controllers/photos.php[ 34 ] » item_Core::get_display_context( arguments ) {PHP internal call} » Photos_Controller->show( arguments ) SYSPATH/core/Kohana.php[ 331 ] » ReflectionMethod->invokeArgs( arguments ) {PHP internal call} » Kohana_Core::instance( arguments ) SYSPATH/core/Event.php[ 208 ] » call_user_func_array( arguments ) APPPATH/Bootstrap.php[ 67 ] » Event_Core::run( arguments ) DOCROOT/index.php[ 116 ] » require( arguments ) Environment |
|
Posts: 183
@DiegoS - Hmm, I suspect this might be related to a recent bug we fixed. Try swapping modules/gallery/libraries/Theme_View.php with the revised one:
For viewing:
http://github.com/gallery/gallery3/blob/3.0.x/modules/gallery/libraries/Theme_View.php
For raw download:
http://raw.github.com/gallery/gallery3/3.0.x/modules/gallery/libraries/Theme_View.php
If you want, you can also get the latest updates for 3.0.5 as a complete zip here:
http://github.com/gallery/gallery3/zipball/3.0.x
Take care,
Shad
Posts: 20
Hi shadlaws,
I've tried but nothing changes.
I modified file gallery3>modules>search>helpers>search.php
and I've replaced all occurences of "ORDER BY `score` DESC "
with
" ORDER BY `score` DESC "
As you can see I've just added a space before ORDER BY.
It works but I'm afraid that can hits some other Gallery function.
Posts: 183
@DiegoS - ah, I see the problem! Yes, you're right - there's a bug there. Thanks for catching that!
I opened a ticket (https://sourceforge.net/apps/trac/gallery/ticket/2062) and posted a fix up to Github which should be in the 3.0.x branch soon.
Thanks,
Shad
Posts: 20
Good !
Thanks,
DiegoS
Posts: 183
@DiegoS - Alright, should be all fixed! The updated search.php is below.
For viewing:
http://github.com/gallery/gallery3/blob/3.0.x/modules/search/helpers/search.php
For raw download:
http://raw.github.com/gallery/gallery3/3.0.x/modules/search/helpers/search.php
As before if you want, you can also get the latest updates for 3.0.5 as a complete zip here:
http://github.com/gallery/gallery3/zipball/3.0.x
Take care,
Shad
Posts: 20
Thanks shad laws!
Diego