diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-11-07 00:18:06 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-11-07 00:18:06 +0100 |
commit | 33fe61f92f4165f5e100499013c141df1e663e60 (patch) | |
tree | ea3729df83295ee6b6f358f258234a9f72c49385 /src | |
parent | 18f8f32f70a3f76b307f4255eee0f51187b07283 (diff) | |
download | wallabag-33fe61f92f4165f5e100499013c141df1e663e60.tar.gz wallabag-33fe61f92f4165f5e100499013c141df1e663e60.tar.zst wallabag-33fe61f92f4165f5e100499013c141df1e663e60.zip |
Fix form_enctype deprecation
Use form_start instead
Diffstat (limited to 'src')
3 files changed, 21 insertions, 19 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index ca4acc6a..8bbe4ca0 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -29,7 +29,7 @@ class ConfigController extends Controller | |||
29 | $user = $this->getUser(); | 29 | $user = $this->getUser(); |
30 | 30 | ||
31 | // handle basic config detail (this form is defined as a service) | 31 | // handle basic config detail (this form is defined as a service) |
32 | $configForm = $this->createForm('config', $config); | 32 | $configForm = $this->createForm('config', $config, array('action' => $this->generateUrl('config'))); |
33 | $configForm->handleRequest($request); | 33 | $configForm->handleRequest($request); |
34 | 34 | ||
35 | if ($configForm->isValid()) { | 35 | if ($configForm->isValid()) { |
@@ -49,7 +49,7 @@ class ConfigController extends Controller | |||
49 | } | 49 | } |
50 | 50 | ||
51 | // handle changing password | 51 | // handle changing password |
52 | $pwdForm = $this->createForm(new ChangePasswordType()); | 52 | $pwdForm = $this->createForm(new ChangePasswordType(), null, array('action' => $this->generateUrl('config').'#set4')); |
53 | $pwdForm->handleRequest($request); | 53 | $pwdForm->handleRequest($request); |
54 | 54 | ||
55 | if ($pwdForm->isValid()) { | 55 | if ($pwdForm->isValid()) { |
@@ -65,7 +65,10 @@ class ConfigController extends Controller | |||
65 | } | 65 | } |
66 | 66 | ||
67 | // handle changing user information | 67 | // handle changing user information |
68 | $userForm = $this->createForm(new UserInformationType(), $user, array('validation_groups' => array('Profile'))); | 68 | $userForm = $this->createForm(new UserInformationType(), $user, array( |
69 | 'validation_groups' => array('Profile'), | ||
70 | 'action' => $this->generateUrl('config').'#set3', | ||
71 | )); | ||
69 | $userForm->handleRequest($request); | 72 | $userForm->handleRequest($request); |
70 | 73 | ||
71 | if ($userForm->isValid()) { | 74 | if ($userForm->isValid()) { |
@@ -80,7 +83,7 @@ class ConfigController extends Controller | |||
80 | } | 83 | } |
81 | 84 | ||
82 | // handle rss information | 85 | // handle rss information |
83 | $rssForm = $this->createForm(new RssType(), $config); | 86 | $rssForm = $this->createForm(new RssType(), $config, array('action' => $this->generateUrl('config').'#set2')); |
84 | $rssForm->handleRequest($request); | 87 | $rssForm->handleRequest($request); |
85 | 88 | ||
86 | if ($rssForm->isValid()) { | 89 | if ($rssForm->isValid()) { |
@@ -99,7 +102,10 @@ class ConfigController extends Controller | |||
99 | $newUser = $userManager->createUser(); | 102 | $newUser = $userManager->createUser(); |
100 | // enable created user by default | 103 | // enable created user by default |
101 | $newUser->setEnabled(true); | 104 | $newUser->setEnabled(true); |
102 | $newUserForm = $this->createForm(new NewUserType(), $newUser, array('validation_groups' => array('Profile'))); | 105 | $newUserForm = $this->createForm(new NewUserType(), $newUser, array( |
106 | 'validation_groups' => array('Profile'), | ||
107 | 'action' => $this->generateUrl('config').'#set5', | ||
108 | )); | ||
103 | $newUserForm->handleRequest($request); | 109 | $newUserForm->handleRequest($request); |
104 | 110 | ||
105 | if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) { | 111 | if ($newUserForm->isValid() && $this->get('security.authorization_checker')->isGranted('ROLE_SUPER_ADMIN')) { |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig index abe5dc9e..7a7d6af1 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Config/index.html.twig | |||
@@ -5,7 +5,7 @@ | |||
5 | {% block content %} | 5 | {% block content %} |
6 | <h2>{% trans %}Wallabag configuration{% endtrans %}</h2> | 6 | <h2>{% trans %}Wallabag configuration{% endtrans %}</h2> |
7 | 7 | ||
8 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.config) }}> | 8 | {{ form_start(form.config) }} |
9 | {{ form_errors(form.config) }} | 9 | {{ form_errors(form.config) }} |
10 | 10 | ||
11 | <fieldset class="w500p inline"> | 11 | <fieldset class="w500p inline"> |
@@ -37,7 +37,7 @@ | |||
37 | 37 | ||
38 | <h2>{% trans %}RSS configuration{% endtrans %}</h2> | 38 | <h2>{% trans %}RSS configuration{% endtrans %}</h2> |
39 | 39 | ||
40 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.rss) }}> | 40 | {{ form_start(form.rss) }} |
41 | {{ form_errors(form.rss) }} | 41 | {{ form_errors(form.rss) }} |
42 | 42 | ||
43 | <fieldset class="w500p inline"> | 43 | <fieldset class="w500p inline"> |
@@ -81,7 +81,7 @@ | |||
81 | 81 | ||
82 | <h2>{% trans %}User information{% endtrans %}</h2> | 82 | <h2>{% trans %}User information{% endtrans %}</h2> |
83 | 83 | ||
84 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.user) }}> | 84 | {{ form_start(form.user) }} |
85 | {{ form_errors(form.user) }} | 85 | {{ form_errors(form.user) }} |
86 | 86 | ||
87 | <fieldset class="w500p inline"> | 87 | <fieldset class="w500p inline"> |
@@ -115,7 +115,7 @@ | |||
115 | 115 | ||
116 | <h2>{% trans %}Change your password{% endtrans %}</h2> | 116 | <h2>{% trans %}Change your password{% endtrans %}</h2> |
117 | 117 | ||
118 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.pwd) }}> | 118 | {{ form_start(form.pwd) }} |
119 | {{ form_errors(form.pwd) }} | 119 | {{ form_errors(form.pwd) }} |
120 | 120 | ||
121 | <fieldset class="w500p inline"> | 121 | <fieldset class="w500p inline"> |
@@ -148,7 +148,7 @@ | |||
148 | {% if is_granted('ROLE_SUPER_ADMIN') %} | 148 | {% if is_granted('ROLE_SUPER_ADMIN') %} |
149 | <h2>{% trans %}Add a user{% endtrans %}</h2> | 149 | <h2>{% trans %}Add a user{% endtrans %}</h2> |
150 | 150 | ||
151 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.new_user) }}> | 151 | {{ form_start(form.new_user) }} |
152 | {{ form_errors(form.new_user) }} | 152 | {{ form_errors(form.new_user) }} |
153 | 153 | ||
154 | <fieldset class="w500p inline"> | 154 | <fieldset class="w500p inline"> |
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig index ab24d4ef..8f121a2b 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Config/index.html.twig | |||
@@ -21,9 +21,8 @@ | |||
21 | </ul> | 21 | </ul> |
22 | </div> | 22 | </div> |
23 | 23 | ||
24 | |||
25 | <div id="set1" class="col s12"> | 24 | <div id="set1" class="col s12"> |
26 | <form action="{{ path('config') }}" method="post" {{ form_enctype(form.config) }}> | 25 | {{ form_start(form.config) }} |
27 | {{ form_errors(form.config) }} | 26 | {{ form_errors(form.config) }} |
28 | 27 | ||
29 | <div class="row"> | 28 | <div class="row"> |
@@ -57,9 +56,8 @@ | |||
57 | </form> | 56 | </form> |
58 | </div> | 57 | </div> |
59 | 58 | ||
60 | |||
61 | <div id="set2" class="col s12"> | 59 | <div id="set2" class="col s12"> |
62 | <form action="{{ path('config') }}#set2" method="post" {{ form_enctype(form.rss) }}> | 60 | {{ form_start(form.rss) }} |
63 | {{ form_errors(form.rss) }} | 61 | {{ form_errors(form.rss) }} |
64 | 62 | ||
65 | <div class="row"> | 63 | <div class="row"> |
@@ -111,9 +109,8 @@ | |||
111 | </form> | 109 | </form> |
112 | </div> | 110 | </div> |
113 | 111 | ||
114 | |||
115 | <div id="set3" class="col s12"> | 112 | <div id="set3" class="col s12"> |
116 | <form action="{{ path('config') }}#set3" method="post" {{ form_enctype(form.user) }}> | 113 | {{ form_start(form.user) }} |
117 | {{ form_errors(form.user) }} | 114 | {{ form_errors(form.user) }} |
118 | 115 | ||
119 | <div class="row"> | 116 | <div class="row"> |
@@ -150,9 +147,8 @@ | |||
150 | </form> | 147 | </form> |
151 | </div> | 148 | </div> |
152 | 149 | ||
153 | |||
154 | <div id="set4" class="col s12"> | 150 | <div id="set4" class="col s12"> |
155 | <form action="{{ path('config') }}#set4" method="post" {{ form_enctype(form.pwd) }}> | 151 | {{ form_start(form.pwd) }} |
156 | {{ form_errors(form.pwd) }} | 152 | {{ form_errors(form.pwd) }} |
157 | 153 | ||
158 | <div class="row"> | 154 | <div class="row"> |
@@ -189,7 +185,7 @@ | |||
189 | 185 | ||
190 | {% if is_granted('ROLE_SUPER_ADMIN') %} | 186 | {% if is_granted('ROLE_SUPER_ADMIN') %} |
191 | <div id="set5" class="col s12"> | 187 | <div id="set5" class="col s12"> |
192 | <form action="{{ path('config') }}#set5" method="post" {{ form_enctype(form.new_user) }}> | 188 | {{ form_start(form.new_user) }} |
193 | {{ form_errors(form.new_user) }} | 189 | {{ form_errors(form.new_user) }} |
194 | 190 | ||
195 | <div class="row"> | 191 | <div class="row"> |