aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-02-22 10:50:27 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-02-22 10:50:27 +0100
commit0bd2cb1ecd2f9194735af77142390a94723d1b39 (patch)
tree12441ab858446410686cb93421f93df1f94e0cc9 /src
parente4977b8a866f84f65f08c55c050a62f40170fdbf (diff)
downloadwallabag-0bd2cb1ecd2f9194735af77142390a94723d1b39.tar.gz
wallabag-0bd2cb1ecd2f9194735af77142390a94723d1b39.tar.zst
wallabag-0bd2cb1ecd2f9194735af77142390a94723d1b39.zip
Handle default value for new user
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php9
-rw-r--r--src/Wallabag/CoreBundle/Controller/ConfigController.php8
2 files changed, 12 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index a4301958..c1b72604 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -135,11 +135,10 @@ class InstallCommand extends ContainerAwareCommand
135 135
136 $em->persist($user); 136 $em->persist($user);
137 137
138 $config = new Config(); 138 $config = new Config($user);
139 $config->setUser($user); 139 $config->setTheme($this->getContainer()->getParameter('theme'));
140 $config->setTheme('baggy'); 140 $config->setItemsPerPage($this->getContainer()->getParameter('items_on_page'));
141 $config->setItemsPerPage(10); 141 $config->setLanguage($this->getContainer()->getParameter('language'));
142 $config->setLanguage('en_US');
143 142
144 $em->persist($config); 143 $em->persist($config);
145 } 144 }
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php
index aedbc999..68e034fa 100644
--- a/src/Wallabag/CoreBundle/Controller/ConfigController.php
+++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php
@@ -81,6 +81,14 @@ class ConfigController extends Controller
81 81
82 if ($newUserForm->isValid()) { 82 if ($newUserForm->isValid()) {
83 $em->persist($newUser); 83 $em->persist($newUser);
84
85 $config = new Config($newUser);
86 $config->setTheme($this->container->getParameter('theme'));
87 $config->setItemsPerPage($this->container->getParameter('items_on_page'));
88 $config->setLanguage($this->container->getParameter('language'));
89
90 $em->persist($config);
91
84 $em->flush(); 92 $em->flush();
85 93
86 $this->get('session')->getFlashBag()->add( 94 $this->get('session')->getFlashBag()->add(