Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch the potential DB errors when "#__postinstall_messages" is missing #2840

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 11 additions & 2 deletions administrator/components/com_cpanel/views/cpanel/view.html.php
Expand Up @@ -56,8 +56,17 @@ public function display($tpl = null)
}

$messages_model = FOFModel::getTmpInstance('Messages', 'PostinstallModel', array('input' => array('eid' => 700)));
$messages = $messages_model->getItemList();

try
{
$messages = $messages_model->getItemList();
}
catch (RuntimeException $e)
{
$messages = array();

// Still render the error message from the Exception object
JFactory::getApplication()->enqueueMessage($e->getMessage(), 'error');
}
$this->postinstall_message_count = count($messages);

parent::display($tpl);
Expand Down