]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Controller/EntryController.php
remove old implementation for login/register/recover
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Controller / EntryController.php
index a77489e250cf0c6b2a9f9bd1d68e291cf6b110e0..a9f35c36dc51dd5349bca30d0effb9034508d139 100644 (file)
@@ -6,7 +6,6 @@ use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
 use Symfony\Bundle\FrameworkBundle\Controller\Controller;
 use Symfony\Component\HttpFoundation\Request;
 use Wallabag\CoreBundle\Entity\Entry;
-use Wallabag\CoreBundle\Service\Extractor;
 use Wallabag\CoreBundle\Form\Type\NewEntryType;
 use Wallabag\CoreBundle\Form\Type\EditEntryType;
 use Wallabag\CoreBundle\Filter\EntryFilterType;
@@ -31,10 +30,7 @@ class EntryController extends Controller
         $form->handleRequest($request);
 
         if ($form->isValid()) {
-            $content = Extractor::extract($entry->getUrl());
-
-            $entry->setTitle($content->getTitle());
-            $entry->setContent($content->getBody());
+            $entry = $this->get('wallabag_core.content_proxy')->updateEntry($entry, $entry->getUrl());
 
             $em = $this->getDoctrine()->getManager();
             $em->persist($entry);
@@ -196,7 +192,7 @@ class EntryController extends Controller
                 throw new \InvalidArgumentException(sprintf('Type "%s" is not implemented.', $type));
         }
 
-        $form = $this->get('form.factory')->create(new EntryFilterType());
+        $form = $this->get('form.factory')->create(new EntryFilterType($repository, $this->getUser()));
 
         if ($request->query->has($form->getName())) {
             // manually bind values from the request