Selaa lähdekoodia

Corrction focus formulaire new

Sangfroid 2 kuukautta sitten
vanhempi
commit
b0021b2a86
2 muutettua tiedostoa jossa 3 lisäystä ja 2 poistoa
  1. 1 1
      src/Controller/ArticleController.php
  2. 2 1
      src/Form/ArticleType.php

+ 1 - 1
src/Controller/ArticleController.php

@@ -5,7 +5,6 @@ namespace App\Controller;
 use App\Entity\Article;
 use App\Form\ArticleType;
 use App\Repository\ArticleRepository;
-use Doctrine\Common\Collections\Order;
 use Doctrine\ORM\EntityManagerInterface;
 use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
 use Symfony\Component\DependencyInjection\Attribute\Target;
@@ -36,6 +35,7 @@ final class ArticleController extends AbstractController
     ): Response
     {
         $article = new Article($this->getUser());
+        $article->setContent('');
         $workflow->getMarking($article);
 
         $transitions = $workflow->getEnabledTransitions($article);

+ 2 - 1
src/Form/ArticleType.php

@@ -29,8 +29,9 @@ class ArticleType extends AbstractType
                 ],
             ])
             ->add('content', TextareaType::class, [
+                'required'  => false,
                 'attr'  =>  [
-                    'data-controller'   => 'easymde'
+                    'data-controller'   => 'easymde',
                 ]
             ])
             ->add('publicationDate', null, [