Skip to content

Commit 35dd05e

Browse files
committed
minor symfony#45 Minor improvment (JulienItard)
This PR was squashed before being merged into the master branch (closes symfony#45). Discussion ---------- Minor improvment - Add french translation - Fix comments typo - Add isSubmitted call + remove useless method attribute Commits ------- 5dce02e Minor improvment
2 parents 3b14460 + 5dce02e commit 35dd05e

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0"?>
2+
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
3+
<file source-language="en" target-language="fr" datatype="plaintext" original="file.ext">
4+
<body>
5+
<trans-unit id="1">
6+
<source>title.post_list</source>
7+
<target>Liste des articles</target>
8+
</trans-unit>
9+
<trans-unit id="2">
10+
<source>action.show</source>
11+
<target>Voir</target>
12+
</trans-unit>
13+
<trans-unit id="3">
14+
<source>action.edit</source>
15+
<target>Editer</target>
16+
</trans-unit>
17+
<trans-unit id="4">
18+
<source>action.create_post</source>
19+
<target>Créer un nouvel article</target>
20+
</trans-unit>
21+
</body>
22+
</file>
23+
</xliff>

app/config/security.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
security:
22
encoders:
3-
# Our use class and the algorithm we'll use to encode passwords
3+
# Our user class and the algorithm we'll use to encode passwords
44
# http://symfony.com/doc/current/book/security.html#encoding-the-user-s-password
55
AppBundle\Entity\User: bcrypt
66

src/AppBundle/Controller/Admin/BlogController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ public function deleteAction(Request $request, Post $post)
156156
$form = $this->createDeleteForm($post);
157157
$form->handleRequest($request);
158158

159-
if ($form->isValid()) {
159+
if ($form->isSubmitted() && $form->isValid()) {
160160
$em = $this->getDoctrine()->getManager();
161161

162162
$em->remove($post);

src/AppBundle/Controller/BlogController.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function postShowAction(Post $post)
6969
*/
7070
public function commentNewAction(Request $request, Post $post)
7171
{
72-
$form = $this->createCommentForm($post);
72+
$form = $this->createCommentForm();
7373

7474
$form->handleRequest($request);
7575

@@ -107,7 +107,7 @@ public function commentNewAction(Request $request, Post $post)
107107
*/
108108
public function commentFormAction(Post $post)
109109
{
110-
$form = $this->createCommentForm($post);
110+
$form = $this->createCommentForm();
111111

112112
return $this->render('blog/comment_form.html.twig', array(
113113
'post' => $post,
@@ -116,7 +116,7 @@ public function commentFormAction(Post $post)
116116
}
117117

118118
/**
119-
* This is a utility method used to create comment forms. It's recommended
119+
* This is an utility method used to create comment forms. It's recommended
120120
* to not define this kind of methods in a controller class, but sometimes
121121
* is convenient for defining small methods.
122122
*/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy