Put default fetching error title in global config

This commit is contained in:
Jerome Charaoui 2016-12-06 22:27:08 -05:00 committed by Jeremy Benoist
parent 7aba665e48
commit 1c5da417e4
No known key found for this signature in database
GPG key ID: FB413A58C7715C86
5 changed files with 5 additions and 3 deletions

View file

@ -58,6 +58,7 @@ wallabag_core:
cache_lifetime: 10
action_mark_as_read: 1
list_mode: 0
fetching_error_message_title: 'No title found'
fetching_error_message: |
wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
api_limit_mass_actions: 10

View file

@ -60,9 +60,6 @@ class EntryController extends Controller
*/
private function updateEntry(Entry $entry, $prefixMessage = 'entry_saved')
{
// put default title in case of fetching content failed
$entry->setTitle('No title found');
$message = 'flashes.entry.notice.'.$prefixMessage;
try {

View file

@ -41,6 +41,8 @@ class Configuration implements ConfigurationInterface
->end()
->scalarNode('fetching_error_message')
->end()
->scalarNode('fetching_error_message_title')
->end()
->scalarNode('action_mark_as_read')
->defaultValue(1)
->end()

View file

@ -26,6 +26,7 @@ class WallabagCoreExtension extends Extension
$container->setParameter('wallabag_core.action_mark_as_read', $config['action_mark_as_read']);
$container->setParameter('wallabag_core.list_mode', $config['list_mode']);
$container->setParameter('wallabag_core.fetching_error_message', $config['fetching_error_message']);
$container->setParameter('wallabag_core.fetching_error_message_title', $config['fetching_error_message_title']);
$container->setParameter('wallabag_core.api_limit_mass_actions', $config['api_limit_mass_actions']);
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));

View file

@ -41,6 +41,7 @@ services:
arguments:
-
error_message: '%wallabag_core.fetching_error_message%'
error_message_title: '%wallabag_core.fetching_error_message_title%'
- "@wallabag_core.guzzle.http_client"
- "@wallabag_core.graby.config_builder"
calls: