Show last parsing error message in user interface

This commit is contained in:
Frederic Guillot 2016-12-27 21:59:09 -05:00
parent d236afeb74
commit 0b45f1b863
21 changed files with 51 additions and 39 deletions

View File

@ -11,6 +11,7 @@ Version 1.2.0 (unreleased)
* Fever API tokens are longer than before
* Always update feed URL to avoid useless redirections for futures requests
* Add support for Wallabag service
* Show last parsing error message in user interface
* Add unit tests
Migration procedure from 1.1.x to 1.2.0:

View File

@ -49,6 +49,7 @@ Router\post_action('edit-feed', function () {
'rtl' => 0,
'cloak_referrer' => 0,
'parsing_error' => 0,
'parsing_error_message' => '',
'feed_group_ids' => array(),
);

View File

@ -107,6 +107,7 @@ function update_feed($user_id, $feed_id)
Model\Feed\update_feed($user_id, $feed_id, array(
'last_checked' => time(),
'parsing_error' => 1,
'parsing_error_message' => $error_message,
));
return false;
@ -118,6 +119,7 @@ function update_feed($user_id, $feed_id)
'last_modified' => $resource->getLastModified(),
'last_checked' => time(),
'parsing_error' => 0,
'parsing_error_message' => '',
));
}

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'لتجنب التحذيرات الخاصة بـ HTTPS',
'Download favicons' => 'تحميل أيقونة الموقع الإلكتروني',
'general' => 'عام',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => '%sconsole%s يوجد خطأ أثناء عملية التحديث!! .. قم بالتحديث يدوياً ثم إذهب إلى نافذة لفحص إشعارات الخطأ',
'Refresh interval in minutes for unread counter' => ':الفترة الزمنية بالدقائق لتحديث عداد العناوين الغير مقروءه',
'Nothing to show. Enable the debug mode to see log messages.' => 'لا يوجد ما يمكن عرضه. قم بتفعيل خيار التصحيح ',
'Enable debug mode' => 'تفعيل وضح التصحيح',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Vyhne se varování o pomíchaném obsahu s HTTPS',
'Download favicons' => 'Stahovat favicony',
'general' => 'základní',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Nastala chyba při poslední kontrole. Obnovte zdroj ručně a poté zkontrolujte %skonzoli%s na chyby!',
'Refresh interval in minutes for unread counter' => 'Obnovovací interval v minutách pro počítadlo nepřečtených',
'Nothing to show. Enable the debug mode to see log messages.' => 'Není co ukázat. Povolte ladící režim pro zobrazení záznamů.',
'Enable debug mode' => 'Povolit ladící režim',
@ -244,4 +243,5 @@ return array(
'Send bookmarks to Wallabag' => 'Poslat záložky na Wallabag',
'Wallabag username' => 'Wallabag uživatelské jmnéno',
'Wallabag password' => 'Wallabah heslo',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Vermeidet Warnungen wegen gemischtem Inhalt bei HTTPS',
'Download favicons' => 'Favicons herunterladen',
'general' => 'allgemein',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Fehler bei der letzten Aktualisierung. Aktualisiere den Feed manuell und prüfe die %sKonsole%s anschließend auf Fehler!',
'Refresh interval in minutes for unread counter' => 'Ungelesen-Anzahl aktualisieren (in minuten)',
'Nothing to show. Enable the debug mode to see log messages.' => 'Keine Daten verfügbar. Schalte den Debug-Modus ein, um Log-Nachrichten zu sehen.',
'Enable debug mode' => 'Debug-Modus einschalten',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Evitar avisos de contenido inseguro con HTTPS',
'Download favicons' => 'Descargar favicons',
'general' => 'general',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Ha ocurrido un error durante la última actualización. Refresque el canal manualmente y revise los errores en la consola después',
'Refresh interval in minutes for unread counter' => 'Intervalo de actualización en minutos del contador de artículos sin leer',
'Nothing to show. Enable the debug mode to see log messages.' => 'Nada que mostrar. Active el modo de depuración para ver los mensages del log',
'Enable debug mode' => 'Activar modo de depuración',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Évite les alertes du navigateur web en HTTPS',
'Download favicons' => 'Télécharger les icônes des sites web',
'general' => 'général',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Une erreur est survenue pendant la dernière vérification. Actualisez le flux manuellement et vérifiez les erreurs dans la %sconsole%s !',
'Refresh interval in minutes for unread counter' => 'Fréquence d\'actualisation en minute du compteur de non lus',
'Nothing to show. Enable the debug mode to see log messages.' => 'Rien à montrer. Activez le mode debug pour voir les messages de log.',
'Enable debug mode' => 'Activer le mode debug',
@ -239,9 +238,10 @@ return array(
'Item title links to' => 'Le titre des articles redirige vers',
'Original' => 'Original',
'Last login:' => 'Dernière connexion :',
// 'Search' => '',
// 'There are no results for your search' => '',
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
'Search' => 'Recherche',
'There are no results for your search' => 'Il n\'y a aucun résultat pour votre recherche.',
'Send bookmarks to Wallabag' => 'Envoyer les favoris vers Wallabag',
'Wallabag username' => 'Identifiant Wallabag',
'Wallabag password' => 'Mot de passe Wallabag',
'An error occurred during the last check: "%s".' => 'Une erreur est survenue pendant la dernière vérification : « %s ».',
);

View File

@ -218,7 +218,6 @@ return array(
// 'Avoid mixed content warnings with HTTPS' => '',
// 'Download favicons' => '',
// 'general' => '',
// 'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => '',
// 'Refresh interval in minutes for unread counter' => '',
// 'Nothing to show. Enable the debug mode to see log messages.' => '',
// 'Enable debug mode' => '',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -220,7 +220,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'HTTPSとHTTPの混合コンテンツの警告を回避',
'Download favicons' => 'faviconをダウンロード',
'general' => '一般',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => '最後のチェック中にエラーが発生しました。手動でフィードを更新し、エラーを%sコンソール%sで確認してください。',
'Refresh interval in minutes for unread counter' => '未読数の更新間隔(分単位)',
'Nothing to show. Enable the debug mode to see log messages.' => '表示するものが何もありません。ログメッセージを表示するにはデバッグモードを有効にします。',
'Enable debug mode' => 'デバッグモードを有効化',
@ -246,4 +245,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Evita alertas de mistura de conteúdo HTTPS',
'Download favicons' => 'Download favicon',
// 'general' => '',
// 'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => '',
// 'Refresh interval in minutes for unread counter' => '',
// 'Nothing to show. Enable the debug mode to see log messages.' => '',
// 'Enable debug mode' => '',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Избегайте передупреждений о смешанном содержимом в HTTPS',
'Download favicons' => 'Скачивать иконки сайтов',
'general' => 'общие',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Во время последней проверки возникла ошибка. Обновите канал вручную, а потом проверьте %sconsole%s на наличие ошибок!',
'Refresh interval in minutes for unread counter' => 'Интервал обновления счетчика непрочитанных статей в минутах',
'Nothing to show. Enable the debug mode to see log messages.' => 'Пока ничего нет. Включите отладочный режим, чтобы увидеть сообщения.',
'Enable debug mode' => 'Включить отладочный режим',
@ -244,4 +243,5 @@ return array(
'Send bookmarks to Wallabag' => 'Отправлять закладки в Wallabag',
'Wallabag username' => 'Имя пользователя Wallabag',
'Wallabag password' => 'Пароль Wallabag',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Избегавај упозорења о помешаном садржају када се користи HTTPS',
'Download favicons' => 'Скидај иконице веб сајтова',
'general' => 'опште',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Дошло је до грењке током последње провере. Освежите feed ручно и проверите %sконзолу%s после тога!',
'Refresh interval in minutes for unread counter' => 'Број минута после којих се освежава бројач непрочитаних ставки',
'Nothing to show. Enable the debug mode to see log messages.' => 'Овде нема ничег. Активирајте мод за дебаговање да бисте видели поруке дневника.',
'Enable debug mode' => 'Активирај мод за дебаговање',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'Izbegavaj upozorenja o pomešanom sadržaju kada se koristi HTTPS',
'Download favicons' => 'Skidaj ikonice veb sajtova',
'general' => 'opšte',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Došlo je do grenjke tokom poslednje provere. Osvežite feed ručno i proverite %skonzolu%s posle toga!',
'Refresh interval in minutes for unread counter' => 'Broj minuta posle kojih se osvežava brojač nepročitanih stavki',
'Nothing to show. Enable the debug mode to see log messages.' => 'Ovde nema ničeg. Aktivirajte mod za debagovanje da biste videli poruke dnevnika.',
'Enable debug mode' => 'Aktiviraj mod za debagovanje',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => 'HTTP veya HTTPS bağlantı kullanan içeriklerde önerilmez',
'Download favicons' => 'İnternet sitesi ikonlarını (favicon) indir',
'general' => 'genel',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => 'Son kontrol sırasında bir hata oluştu. Akışı elle yenileyin ve daha sonra hataları %skonsol%s üzerinde kontrol edin!',
'Refresh interval in minutes for unread counter' => 'Okunmayanlar için dakika cinsinden yenileme aralığı',
'Nothing to show. Enable the debug mode to see log messages.' => 'Gösterilecek bir şey yok. Hata ayıklama modunu aktifleştirerek hata mesajlarını görebilirsin.',
'Enable debug mode' => 'Hata ayıklama modunu etkinleştir',
@ -244,4 +243,5 @@ return array(
// 'Send bookmarks to Wallabag' => '',
// 'Wallabag username' => '',
// 'Wallabag password' => '',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -218,7 +218,6 @@ return array(
'Avoid mixed content warnings with HTTPS' => '避免HTTPS包含HTTP内容的警告',
'Download favicons' => '下载站标',
'general' => '通用',
'An error occurred during the last check. Refresh the feed manually and check the %sconsole%s for errors afterwards!' => '在最近一次检查中发生了错误,手动刷新这个订阅源并检查[%s控制台%s]错误信息!',
'Refresh interval in minutes for unread counter' => '未读计数刷新间隔时间(分钟)',
'Nothing to show. Enable the debug mode to see log messages.' => '没有可以显示的,开启调试模式以便查看日志',
'Enable debug mode' => '开启调试模式',
@ -244,4 +243,5 @@ return array(
'Send bookmarks to Wallabag' => '把书签发送到Wallabag',
'Wallabag username' => 'Wallabag用户名',
'Wallabag password' => 'Wallabag密码',
// 'An error occurred during the last check: "%s".' => '',
);

View File

@ -5,7 +5,12 @@ namespace Miniflux\Schema;
use PDO;
use Miniflux\Helper;
const VERSION = 1;
const VERSION = 2;
function version_2(PDO $pdo)
{
$pdo->exec('ALTER TABLE feeds ADD COLUMN parsing_error_message VARCHAR(255)');
}
function version_1(PDO $pdo)
{

View File

@ -5,7 +5,12 @@ namespace Miniflux\Schema;
use PDO;
use Miniflux\Helper;
const VERSION = 1;
const VERSION = 2;
function version_2(PDO $pdo)
{
$pdo->exec('ALTER TABLE feeds ADD COLUMN parsing_error_message TEXT');
}
function version_1(PDO $pdo)
{

View File

@ -24,7 +24,7 @@
<?php if ($feed['parsing_error']): ?>
<p class="alert alert-error">
<?php echo t('An error occurred during the last check. You could enable the debug mode to have more information.') ?>
<?php echo t('An error occurred during the last check: "%s".', $feed['parsing_error_message']) ?>
</p>
<?php endif; ?>

View File

@ -17,9 +17,7 @@
<?php else: ?>
<?php if ($nb_failed_feeds > 0): ?>
<p class="alert alert-error"><?php echo t('An error occurred during the last check. You could enable the debug mode to have more information.') ?></p>
<?php elseif ($nothing_to_read): ?>
<?php if ($nothing_to_read): ?>
<p class="alert alert-info"><?php echo tne('Nothing to read, do you want to %supdate your subscriptions%s?','<a href="?action=refresh-all" data-action="refresh-all">','</a>') ?></p>
<?php endif ?>
@ -51,7 +49,7 @@
<?php endif ?>
<span class="feed-parsing-error">
<?php echo t('(error occurred during the last check)') ?>
<?php echo t('An error occurred during the last check: "%s".', $feed['parsing_error_message']) ?>
</span>
<?php endif ?>

View File

@ -519,7 +519,7 @@ nav .active a {
visibility: visible;
color: #000;
font-size: 0.7em;
font-weight: normal;
font-weight: bold;
}
.items article {