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 +++++- src/Wallabag/CoreBundle/Form/Type/ConfigType.php | 4 ++++ src/Wallabag/CoreBundle/Form/Type/EditEntryType.php | 1 + src/Wallabag/CoreBundle/Form/Type/RssType.php | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/Wallabag') 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']) ; diff --git a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php index 7e3b9dd4..1714ce74 100644 --- a/src/Wallabag/CoreBundle/Form/Type/ConfigType.php +++ b/src/Wallabag/CoreBundle/Form/Type/ConfigType.php @@ -39,9 +39,11 @@ class ConfigType extends AbstractType ]) ->add('items_per_page', null, [ 'label' => 'config.form_settings.items_per_page_label', + 'property_path' => 'itemsPerPage', ]) ->add('reading_speed', ChoiceType::class, [ 'label' => 'config.form_settings.reading_speed.label', + 'property_path' => 'readingSpeed', 'choices' => [ 'config.form_settings.reading_speed.100_word' => '0.5', 'config.form_settings.reading_speed.200_word' => '1', @@ -51,6 +53,7 @@ class ConfigType extends AbstractType ]) ->add('action_mark_as_read', ChoiceType::class, [ 'label' => 'config.form_settings.action_mark_as_read.label', + 'property_path' => 'actionMarkAsRead', 'choices' => [ 'config.form_settings.action_mark_as_read.redirect_homepage' => Config::REDIRECT_TO_HOMEPAGE, 'config.form_settings.action_mark_as_read.redirect_current_page' => Config::REDIRECT_TO_CURRENT_PAGE, @@ -61,6 +64,7 @@ class ConfigType extends AbstractType 'label' => 'config.form_settings.language_label', ]) ->add('pocket_consumer_key', null, [ + 'property_path' => 'pocketConsumerKey', 'label' => 'config.form_settings.pocket_consumer_key_label', ]) ->add('save', SubmitType::class, [ diff --git a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php index 40e5b5b9..c3715646 100644 --- a/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php +++ b/src/Wallabag/CoreBundle/Form/Type/EditEntryType.php @@ -21,6 +21,7 @@ class EditEntryType extends AbstractType ->add('is_public', CheckboxType::class, [ 'required' => false, 'label' => 'entry.edit.is_public_label', + 'property_path' => 'isPublic', ]) ->add('url', TextType::class, [ 'disabled' => true, diff --git a/src/Wallabag/CoreBundle/Form/Type/RssType.php b/src/Wallabag/CoreBundle/Form/Type/RssType.php index 94324fed..49b31c1e 100644 --- a/src/Wallabag/CoreBundle/Form/Type/RssType.php +++ b/src/Wallabag/CoreBundle/Form/Type/RssType.php @@ -14,6 +14,7 @@ class RssType extends AbstractType $builder ->add('rss_limit', null, [ 'label' => 'config.form_rss.rss_limit', + 'property_path' => 'rssLimit', ]) ->add('save', SubmitType::class, [ 'label' => 'config.form.save', -- cgit v1.2.3 From f3c300e4858c22db01188435aadf14768365b6f3 Mon Sep 17 00:00:00 2001 From: adev Date: Sat, 6 May 2017 22:21:04 +0200 Subject: Translate error message in login page Fix #2933 --- src/Wallabag/UserBundle/Resources/views/Security/login.html.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig index fc0d97e7..32984c84 100644 --- a/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig +++ b/src/Wallabag/UserBundle/Resources/views/Security/login.html.twig @@ -5,7 +5,7 @@
{% if error %} - + {% endif %} {% for flashMessage in app.session.flashbag.get('notice') %} -- 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') 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 From 9d7d54971215ef214db1292f850b3bb0402b2f84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Benoist?= Date: Tue, 9 May 2017 09:22:50 +0200 Subject: Update graby* licenses --- .../CoreBundle/Resources/views/themes/common/Static/about.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Wallabag') diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig index db193e81..f82e5dc5 100644 --- a/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig +++ b/src/Wallabag/CoreBundle/Resources/views/themes/common/Static/about.html.twig @@ -106,8 +106,8 @@ hoa/zformatBSD-3-Clause htmlawed/htmlawedGPL-2.0+ or LGPL-3.0 incenteev/composer-parameter-handlerMIT - j0k3r/grabyAGPL-3.0 - j0k3r/graby-site-configAGPL-3.0 + j0k3r/grabyMIT + j0k3r/graby-site-configPublic domain j0k3r/php-readabilityApache-2.0 j0k3r/safecurlMIT jdorn/sql-formatterMIT -- cgit v1.2.3