We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 845303ef authored by Mike Sheldon's avatar Mike Sheldon

Don't query for 'false' mbid if none is supplied, fails on recent postgres...

Don't query for 'false' mbid if none is supplied, fails on recent postgres versions due to automatic casts from boolean to varchar being deprecated
parent 97c722ec
......@@ -49,9 +49,14 @@ class Artist {
global $adodb;
$adodb->SetFetchMode(ADODB_FETCH_ASSOC);
$row = $adodb->CacheGetRow(1200, 'SELECT name, mbid, streamable, bio_published, bio_content, bio_summary, image_small, image_medium, image_large FROM Artist WHERE '
. 'mbid = ' . $adodb->qstr($mbid) . ' OR '
. 'name = ' . $adodb->qstr($name));
if($mbid) {
$row = $adodb->CacheGetRow(1200, 'SELECT name, mbid, streamable, bio_published, bio_content, bio_summary, image_small, image_medium, image_large FROM Artist WHERE '
. 'mbid = ' . $adodb->qstr($mbid) . ' OR '
. 'name = ' . $adodb->qstr($name));
} else {
$row = $adodb->CacheGetRow(1200, 'SELECT name, mbid, streamable, bio_published, bio_content, bio_summary, image_small, image_medium, image_large FROM Artist WHERE '
. 'name = ' . $adodb->qstr($name));
}
if(!$row) {
throw new Exception('No such artist' . $name);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment