Commit e11a94ed authored by profix898's avatar profix898

- bugfix: empty title not handled in status reports

- bugfix: version mismatch error does not show (#223354)
parent cfc7d434
......@@ -118,13 +118,15 @@ function _gallery_init($full = FALSE, $vars = NULL, $report_error = TRUE) {
include_once($params['g2Dir'] .'embed.php');
$ret = GalleryEmbed::init($params);
if ($ret) {
if ($report_error) {
if ($ret->getErrorCode() & ERROR_PLUGIN_VERSION_MISMATCH) {
gallery_error($vars ? t('Embedding API version is incompatible.') : $init_err_msg, $ret, TRUE);
}
else {
gallery_error($init_err_msg, $ret, TRUE);
if ($ret->getErrorCode() & ERROR_PLUGIN_VERSION_MISMATCH) {
$err_msg = t('Embedding API version is incompatible.');
if ($vars) {
drupal_set_message($err_msg, 'error');
}
gallery_error($vars ? $err_msg : $init_err_msg, $ret, !$vars);
}
else if ($report_error) {
gallery_error($init_err_msg, $ret, TRUE);
}
return FALSE;
}
......
......@@ -1156,8 +1156,11 @@ function gallery_format_status($status = array(), $title = 'Gallery message(s):'
if (count($status)) {
foreach ($status as $item) {
$message .= '<li>';
$message .= empty($item['url']) ? t($item['title']) : '<a href="'. $item['url'] .'">'. t($item['title']) .'</a>';
$message .= (isset($item['info']) && !empty($item['info'])) ? (': '. t($item['info'])) : '';
if (isset($item['title'])) {
$message .= empty($item['url']) ? t($item['title']) : '<a href="'. $item['url'] .'">'. t($item['title']) .'</a>';
$message .= ': ';
}
$message .= (isset($item['info']) && !empty($item['info'])) ? t($item['info']) : '';
$message .= isset($item['severity']) ? (' ['. theme('gallery_severity_message', $item['severity']) .']') : '';
$message .= '</li>';
}
......
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