Skip to content

Commit

Permalink
Dev: Show flash messages when db update goes wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
olleharstedt committed Oct 7, 2016
1 parent 4a8e0d5 commit fb4add0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/helpers/update/update_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ function CheckForDBUpgrades($subaction = null)
}
else
{
$data = "<p><a href='".Yii::app()->getController()->createUrl("/admin/databaseupdate/sa/db")."'>".gT("Please fix this error in your database and try again")."</a></p></div>";
$msg = '';
foreach(yii::app()->user->getflashes() as $key => $message)
{
$msg .= '<div class="alert alert-danger flash-' . $key . '">' . $message . "</div>\n";
}
$data = $msg . "<p><a href='".Yii::app()->getController()->createUrl("/admin/databaseupdate/sa/db")."'>".gT("Please fix this error in your database and try again")."</a></p></div> ";
}
return $data;
}
Expand Down

0 comments on commit fb4add0

Please sign in to comment.