From 1d76102a240c2596832848128a7b9cf5aa2050dd Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 9 Jan 2016 18:38:40 +0100 Subject: 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) --- src/Wallabag/ImportBundle/Controller/PocketController.php | 5 +++-- src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php | 2 +- src/Wallabag/ImportBundle/Form/Type/UploadImportType.php | 8 +++++--- 3 files changed, 9 insertions(+), 6 deletions(-) (limited to 'src/Wallabag/ImportBundle') 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 @@ namespace Wallabag\ImportBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; +use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; class PocketController extends Controller @@ -23,12 +24,12 @@ class PocketController extends Controller public function authAction() { $requestToken = $this->get('wallabag_import.pocket.import') - ->getRequestToken($this->generateUrl('import', [], true)); + ->getRequestToken($this->generateUrl('import', UrlGeneratorInterface::ABSOLUTE_URL)); $this->get('session')->set('import.pocket.code', $requestToken); return $this->redirect( - 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', [], true), + 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', UrlGeneratorInterface::ABSOLUTE_URL), 301 ); } 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 */ public function indexAction(Request $request) { - $form = $this->createForm(new UploadImportType()); + $form = $this->createForm(UploadImportType::class); $form->handleRequest($request); $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; use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\FormBuilderInterface; +use Symfony\Component\Form\Extension\Core\Type\SubmitType; +use Symfony\Component\Form\Extension\Core\Type\FileType; class UploadImportType extends AbstractType { public function buildForm(FormBuilderInterface $builder, array $options) { $builder - ->add('file', 'file') - ->add('save', 'submit') + ->add('file', FileType::class) + ->add('save', SubmitType::class) ; } - public function getName() + public function getBlockPrefix() { return 'upload_import_file'; } -- cgit v1.2.3 From 27e475a9412b0b462da2ddff641fddbeac5c165e Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Wed, 13 Jan 2016 22:53:36 +0100 Subject: Fix Pocket generateUrl parameters --- src/Wallabag/ImportBundle/Controller/PocketController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag/ImportBundle') diff --git a/src/Wallabag/ImportBundle/Controller/PocketController.php b/src/Wallabag/ImportBundle/Controller/PocketController.php index 72dc2696..7aee302f 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketController.php @@ -24,12 +24,12 @@ class PocketController extends Controller public function authAction() { $requestToken = $this->get('wallabag_import.pocket.import') - ->getRequestToken($this->generateUrl('import', UrlGeneratorInterface::ABSOLUTE_URL)); + ->getRequestToken($this->generateUrl('import', array(), UrlGeneratorInterface::ABSOLUTE_URL)); $this->get('session')->set('import.pocket.code', $requestToken); return $this->redirect( - 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', UrlGeneratorInterface::ABSOLUTE_URL), + 'https://getpocket.com/auth/authorize?request_token='.$requestToken.'&redirect_uri='.$this->generateUrl('import_pocket_callback', array(), UrlGeneratorInterface::ABSOLUTE_URL), 301 ); } -- cgit v1.2.3