Commit 27bd7b92 authored by Aaron Wells's avatar Aaron Wells
Browse files

Ignore SQLException when trying to fetch site logo

Bug 1436672: We already check for install, but upgrades can
also cause a problem. Just ignoring the SQLException here covers
all the bases.

Change-Id: I14156700c85290f630d19d6cca67cbc7bf59be45
parent f8050885
......@@ -1097,8 +1097,14 @@ class Theme {
return $this->get_url('images/site-logo-' . $name . '.png');
}
else {
if (get_config('installed') && $sitelogoid = get_field('institution', 'logo', 'name', 'mahara')) {
return get_config('wwwroot') . 'thumb.php?type=logobyid&id=' . $sitelogoid;
try {
$sitelogoid = get_field('institution', 'logo', 'name', 'mahara');
if ($sitelogoid) {
return get_config('wwwroot') . 'thumb.php?type=logobyid&id=' . $sitelogoid;
}
}
catch (SQLException $e) {
// Probably the site hasn't been installed or upgraded yet.
}
}
return $this->get_url('images/site-logo.png');
......
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