From ab9eb5cdb767510c0c2b9d1b114243741f748f89 Mon Sep 17 00:00:00 2001 From: adev Date: Fri, 5 May 2017 00:12:16 +0200 Subject: Fix display the form errors correctly Use `property_path` form option to map underscored form fields to object properties @see https://github.com/symfony/symfony/issues/9162#issuecomment-25431148 Fix #3067 --- src/Wallabag/ApiBundle/Form/Type/ClientType.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/ApiBundle') diff --git a/src/Wallabag/ApiBundle/Form/Type/ClientType.php b/src/Wallabag/ApiBundle/Form/Type/ClientType.php index 0ea1a9c5..eaea4feb 100644 --- a/src/Wallabag/ApiBundle/Form/Type/ClientType.php +++ b/src/Wallabag/ApiBundle/Form/Type/ClientType.php @@ -16,7 +16,11 @@ class ClientType extends AbstractType { $builder ->add('name', TextType::class, ['label' => 'developer.client.form.name_label']) - ->add('redirect_uris', UrlType::class, ['required' => false, 'label' => 'developer.client.form.redirect_uris_label']) + ->add('redirect_uris', UrlType::class, [ + 'required' => false, + 'label' => 'developer.client.form.redirect_uris_label', + 'property_path' => 'redirectUris', + ]) ->add('save', SubmitType::class, ['label' => 'developer.client.form.save_label']) ; -- cgit v1.2.3 From b60a666df22cb9174bdc4506d71cbc9e8ba6b1c9 Mon Sep 17 00:00:00 2001 From: adev Date: Mon, 8 May 2017 16:27:16 +0200 Subject: Fix API pagination is broken if perPage is custom value Fix #2720 --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Wallabag/ApiBundle') diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 2c2ec0c1..c544815e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -98,12 +98,13 @@ class EntryRestController extends WallabagRestController $tags = $request->query->get('tags', ''); $since = $request->query->get('since', 0); + /** @var \Pagerfanta\Pagerfanta $pager */ $pager = $this->getDoctrine() ->getRepository('WallabagCoreBundle:Entry') ->findEntries($this->getUser()->getId(), $isArchived, $isStarred, $sort, $order, $since, $tags); - $pager->setCurrentPage($page); $pager->setMaxPerPage($perPage); + $pager->setCurrentPage($page); $pagerfantaFactory = new PagerfantaFactory('page', 'perPage'); $paginatedCollection = $pagerfantaFactory->createRepresentation( -- cgit v1.2.3