8000 Minor improvment · SofHad/symfony@5dce02e · GitHub
[go: up one dir, main page]

Skip to content

Commit 5dce02e

Browse files
JulienItardjaviereguiluz
authored andcommitted
Minor improvment
1 parent 59a686e commit 5dce02e

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
@@ -152,7 +152,7 @@ public function deleteAction(Request $request, Post $post)
152152
$form = $this->createDeleteForm($post);
153153
$form->handleRequest($request);
154154

155-
if ($form->isValid()) {
155+
if ($form->isSubmitted() && $form->isValid()) {
156156
$em = $this->getDoctrine()->getManager();
157157

158158
$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)
0