Fatal error on accessing album links after update

Status
Not open for further replies.

cos

Founder license
License owner
Joined
Jul 4, 2013
Messages
7
Points
53
Hi,

I've updated to the latest version and everything went fine with the one exception that it throws an error when accessing album links. I can create albums and delete them but can't access them. The chv_albums table contains the entries as it should and I tried repairing it but did not fix it. I get this error:

Fatal error [400]: SQLSTATE[42000]: Syntax error or access violation: 1065 Query was empty
Triggered in /app/lib/classes/class.album.php at line 77

Stack trace:
#0 /app/routes/route.album.php(43): CHV\Album::getSingle('2953', true, true, Array)
#1 /lib/G/classes/class.handler.php(232): G\Handler->{closure}(G\Handler)
#2 /lib/G/classes/class.handler.php(132): G\Handler->processRequest()
#3 /app/loader.php(806): G\Handler->__construct(Array)
#4 /index.php(20): include_once('/app/loader.php')


Thank you!
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
16,471
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
When you get "Query was empty" means that the system tried to issue an empty query, it has no relation with running a repair command in your DB. Having an empty query on that method is really odd.

Change this:
app\lib\classes\class.album.php:
        if ($sumview) {
            $query .= 'UPDATE '.$tables['albums'].' SET album_views = album_views + 1 WHERE album_id=:album_id';
        }
To this:
app\lib\classes\class.album.php:
        if ($sumview) {
            $query .= 'UPDATE '.$tables['albums'].' SET album_views = album_views + 1 WHERE album_id=:album_id';
        }
        var_dump($query);
What you get?
 

cos

Founder license
License owner
Joined
Jul 4, 2013
Messages
7
Points
53
Hi Rodolfo,

This is what I get:

string(339) "SELECT * FROM chv_albums LEFT JOIN chv_users ON chv_albums.album_user_id = chv_users.user_id LEFT JOIN chv_likes ON chv_likes.like_content_type = "album" AND chv_albums.album_id = chv_likes.like_content_id AND chv_likes.like_user_id = 1 WHERE album_id=:album_id; UPDATE chv_albums SET album_views = album_views + 1 WHERE album_id=:album_id"Aw, snap! Internal Server Error - Check your error_log or enable debug_mode = 3 (chevereto.com/docs/debug).


Thanks
 

Rodolfo

Chevereto Developer
Chevereto Staff
Joined
Oct 7, 2008
Messages
16,471
Points
237
Location
Chevereto HQ
Website
rodolfoberrios.com
If $query has something then I don't understand why you get a "query was empty" error. Not saying that the error isn't there, just saying that the information provided has no sense.

I'm sorry but I can't replicate this issue and I'm not seeing this as a bug because it only affects your installation. You should try using a different server or review your db server settings. Try to use the most standard package you can find.
 

Support

New Member
Chevereto Staff
Joined
Jan 11, 2019
Messages
4
Points
3
Unfortunately, this ticket has more than seven days without a reply or feedback from the original poster. We will now consider this ticket abandoned and its now closed.

Don't hesitate to create a new ticket if this matter is still causing you issues.

Ticket closed.
 
Status
Not open for further replies.