aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/ImportBundle
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-01-09 18:38:40 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-01-15 09:35:38 +0100
commit1d76102a240c2596832848128a7b9cf5aa2050dd (patch)
treeba6d7a1b4d5d763ae5bce41fcb9395b7f8b5c5f3 /src/Wallabag/ImportBundle
parent8ba854c068f541039d81524d171769b6e1220171 (diff)
downloadwallabag-1d76102a240c2596832848128a7b9cf5aa2050dd.tar.gz
wallabag-1d76102a240c2596832848128a7b9cf5aa2050dd.tar.zst
wallabag-1d76102a240c2596832848128a7b9cf5aa2050dd.zip
Fix recent update
- some missing url parameters from WallabagRestController & EntryController - use a service for `EntryFilterType` to use fully qualified name instead (so changing class signature) - update ImportBundle (url & form)
Diffstat (limited to 'src/Wallabag/ImportBundle')
-rw-r--r--src/Wallabag/ImportBundle/Controller/PocketController.php5
-rw-r--r--src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php2
-rw-r--r--src/Wallabag/ImportBundle/Form/Type/UploadImportType.php8
3 files changed, 9 insertions, 6 deletions
diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php
index a0853383..72dc2696 100644
--- a/src/Wallabag/ImportBundle/Controller/PocketController.php
+++ b/src/Wallabag/ImportBundle/Controller/PocketController.php
@@ -3,6 +3,7 @@
3namespace Wallabag\ImportBundle\Controller; 3namespace Wallabag\ImportBundle\Controller;
4 4
5use Symfony\Bundle\FrameworkBundle\Controller\Controller; 5use Symfony\Bundle\FrameworkBundle\Controller\Controller;
6use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
6use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; 7use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
7 8
8class PocketController extends Controller 9class PocketController extends Controller
@@ -23,12 +24,12 @@ class PocketController extends Controller
23 public function authAction() 24 public function authAction()
24 { 25 {
25 $requestToken = $this->get('wallabag_import.pocket.import') 26 $requestToken = $this->get('wallabag_import.pocket.import')
26 ->getRequestToken($this->generateUrl('import', [], true)); 27 ->getRequestToken($this->generateUrl('import', UrlGeneratorInterface::ABSOLUTE_URL));
27 28
28 $this->get('session')->set('import.pocket.code', $requestToken); 29 $this->get('session')->set('import.pocket.code', $requestToken);
29 30
30 return $this->redirect( 31 return $this->redirect(
31 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], true), 32 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', UrlGeneratorInterface::ABSOLUTE_URL),
32 301 33 301
33 ); 34 );
34 } 35 }
diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
index e50a6c35..35fe620f 100644
--- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
+++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
@@ -14,7 +14,7 @@ class WallabagV1Controller extends Controller
14 */ 14 */
15 public function indexAction(Request $request) 15 public function indexAction(Request $request)
16 { 16 {
17 $form = $this->createForm(new UploadImportType()); 17 $form = $this->createForm(UploadImportType::class);
18 $form->handleRequest($request); 18 $form->handleRequest($request);
19 19
20 $wallabag = $this->get('wallabag_import.wallabag_v1.import'); 20 $wallabag = $this->get('wallabag_import.wallabag_v1.import');
diff --git a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
index 415890f3..2e6b59cb 100644
--- a/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
+++ b/src/Wallabag/ImportBundle/Form/Type/UploadImportType.php
@@ -4,18 +4,20 @@ namespace Wallabag\ImportBundle\Form\Type;
4 4
5use Symfony\Component\Form\AbstractType; 5use Symfony\Component\Form\AbstractType;
6use Symfony\Component\Form\FormBuilderInterface; 6use Symfony\Component\Form\FormBuilderInterface;
7use Symfony\Component\Form\Extension\Core\Type\SubmitType;
8use Symfony\Component\Form\Extension\Core\Type\FileType;
7 9
8class UploadImportType extends AbstractType 10class UploadImportType extends AbstractType
9{ 11{
10 public function buildForm(FormBuilderInterface $builder, array $options) 12 public function buildForm(FormBuilderInterface $builder, array $options)
11 { 13 {
12 $builder 14 $builder
13 ->add('file', 'file') 15 ->add('file', FileType::class)
14 ->add('save', 'submit') 16 ->add('save', SubmitType::class)
15 ; 17 ;
16 } 18 }
17 19
18 public function getName() 20 public function getBlockPrefix()
19 { 21 {
20 return 'upload_import_file'; 22 return 'upload_import_file';
21 } 23 }