mirror of
https://github.com/wallabag/wallabag.git
synced 2025-01-31 15:55:06 +01:00
Merge pull request #2697 from wallabag/fix-list-mode
Add default value for list_mode
This commit is contained in:
commit
375c9e2d3e
@ -35,7 +35,7 @@ class Version20161128084725 extends AbstractMigration implements ContainerAwareI
|
|||||||
$configTable = $schema->getTable($this->getTable('config'));
|
$configTable = $schema->getTable($this->getTable('config'));
|
||||||
$this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.');
|
$this->skipIf($configTable->hasColumn('list_mode'), 'It seems that you already played this migration.');
|
||||||
|
|
||||||
$configTable->addColumn('list_mode', 'integer');
|
$configTable->addColumn('list_mode', 'integer', ['notnull' => false]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -51,6 +51,8 @@ wallabag_core:
|
|||||||
rss_limit: 50
|
rss_limit: 50
|
||||||
reading_speed: 1
|
reading_speed: 1
|
||||||
cache_lifetime: 10
|
cache_lifetime: 10
|
||||||
|
action_mark_as_read: 1
|
||||||
|
list_mode: 1
|
||||||
fetching_error_message: |
|
fetching_error_message: |
|
||||||
wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
|
wallabag can't retrieve contents for this article. Please <a href="http://doc.wallabag.org/en/master/user/errors_during_fetching.html#how-can-i-help-to-fix-that">troubleshoot this issue</a>.
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$adminConfig->setLanguage('en');
|
$adminConfig->setLanguage('en');
|
||||||
$adminConfig->setPocketConsumerKey('xxxxx');
|
$adminConfig->setPocketConsumerKey('xxxxx');
|
||||||
$adminConfig->setActionMarkAsRead(0);
|
$adminConfig->setActionMarkAsRead(0);
|
||||||
|
$adminConfig->setListMode(0);
|
||||||
|
|
||||||
$manager->persist($adminConfig);
|
$manager->persist($adminConfig);
|
||||||
|
|
||||||
@ -34,6 +35,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$bobConfig->setLanguage('fr');
|
$bobConfig->setLanguage('fr');
|
||||||
$bobConfig->setPocketConsumerKey(null);
|
$bobConfig->setPocketConsumerKey(null);
|
||||||
$bobConfig->setActionMarkAsRead(1);
|
$bobConfig->setActionMarkAsRead(1);
|
||||||
|
$bobConfig->setListMode(1);
|
||||||
|
|
||||||
$manager->persist($bobConfig);
|
$manager->persist($bobConfig);
|
||||||
|
|
||||||
@ -46,6 +48,7 @@ class LoadConfigData extends AbstractFixture implements OrderedFixtureInterface
|
|||||||
$emptyConfig->setLanguage('en');
|
$emptyConfig->setLanguage('en');
|
||||||
$emptyConfig->setPocketConsumerKey(null);
|
$emptyConfig->setPocketConsumerKey(null);
|
||||||
$emptyConfig->setActionMarkAsRead(0);
|
$emptyConfig->setActionMarkAsRead(0);
|
||||||
|
$emptyConfig->setListMode(0);
|
||||||
|
|
||||||
$manager->persist($emptyConfig);
|
$manager->persist($emptyConfig);
|
||||||
|
|
||||||
|
@ -41,6 +41,12 @@ class Configuration implements ConfigurationInterface
|
|||||||
->end()
|
->end()
|
||||||
->scalarNode('fetching_error_message')
|
->scalarNode('fetching_error_message')
|
||||||
->end()
|
->end()
|
||||||
|
->scalarNode('action_mark_as_read')
|
||||||
|
->defaultValue(1)
|
||||||
|
->end()
|
||||||
|
->scalarNode('list_mode')
|
||||||
|
->defaultValue(1)
|
||||||
|
->end()
|
||||||
->end()
|
->end()
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -23,6 +23,8 @@ class WallabagCoreExtension extends Extension
|
|||||||
$container->setParameter('wallabag_core.version', $config['version']);
|
$container->setParameter('wallabag_core.version', $config['version']);
|
||||||
$container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
|
$container->setParameter('wallabag_core.paypal_url', $config['paypal_url']);
|
||||||
$container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']);
|
$container->setParameter('wallabag_core.cache_lifetime', $config['cache_lifetime']);
|
||||||
|
$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', $config['fetching_error_message']);
|
||||||
|
|
||||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||||
|
@ -21,8 +21,10 @@ class CreateConfigListener implements EventSubscriberInterface
|
|||||||
private $rssLimit;
|
private $rssLimit;
|
||||||
private $language;
|
private $language;
|
||||||
private $readingSpeed;
|
private $readingSpeed;
|
||||||
|
private $actionMarkAsRead;
|
||||||
|
private $listMode;
|
||||||
|
|
||||||
public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed)
|
public function __construct(EntityManager $em, $theme, $itemsOnPage, $rssLimit, $language, $readingSpeed, $actionMarkAsRead, $listMode)
|
||||||
{
|
{
|
||||||
$this->em = $em;
|
$this->em = $em;
|
||||||
$this->theme = $theme;
|
$this->theme = $theme;
|
||||||
@ -30,6 +32,8 @@ class CreateConfigListener implements EventSubscriberInterface
|
|||||||
$this->rssLimit = $rssLimit;
|
$this->rssLimit = $rssLimit;
|
||||||
$this->language = $language;
|
$this->language = $language;
|
||||||
$this->readingSpeed = $readingSpeed;
|
$this->readingSpeed = $readingSpeed;
|
||||||
|
$this->actionMarkAsRead = $actionMarkAsRead;
|
||||||
|
$this->listMode = $listMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function getSubscribedEvents()
|
public static function getSubscribedEvents()
|
||||||
@ -51,6 +55,8 @@ class CreateConfigListener implements EventSubscriberInterface
|
|||||||
$config->setRssLimit($this->rssLimit);
|
$config->setRssLimit($this->rssLimit);
|
||||||
$config->setLanguage($this->language);
|
$config->setLanguage($this->language);
|
||||||
$config->setReadingSpeed($this->readingSpeed);
|
$config->setReadingSpeed($this->readingSpeed);
|
||||||
|
$config->setActionMarkAsRead($this->actionMarkAsRead);
|
||||||
|
$config->setListMode($this->listMode);
|
||||||
|
|
||||||
$this->em->persist($config);
|
$this->em->persist($config);
|
||||||
$this->em->flush();
|
$this->em->flush();
|
||||||
|
@ -31,5 +31,7 @@ services:
|
|||||||
- "%wallabag_core.rss_limit%"
|
- "%wallabag_core.rss_limit%"
|
||||||
- "%wallabag_core.language%"
|
- "%wallabag_core.language%"
|
||||||
- "%wallabag_core.reading_speed%"
|
- "%wallabag_core.reading_speed%"
|
||||||
|
- "%wallabag_core.action_mark_as_read%"
|
||||||
|
- "%wallabag_core.list_mode%"
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_subscriber }
|
- { name: kernel.event_subscriber }
|
||||||
|
@ -31,6 +31,8 @@ class CreateConfigListenerTest extends \PHPUnit_Framework_TestCase
|
|||||||
20,
|
20,
|
||||||
50,
|
50,
|
||||||
'fr',
|
'fr',
|
||||||
|
1,
|
||||||
|
1,
|
||||||
1
|
1
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user