From 2c3e148b0029a094431622feac79fafcd0d43fc8 Mon Sep 17 00:00:00 2001 From: adev Date: Sun, 7 May 2017 17:21:30 +0200 Subject: Displays an error with an annotation with a too long quote Fix #2762 --- .../AnnotationBundle/Form/EditAnnotationType.php | 18 +++++++++++ .../AnnotationBundle/Form/NewAnnotationType.php | 35 ++++++++++++++++++++++ src/Wallabag/AnnotationBundle/Form/RangeType.php | 19 ++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 src/Wallabag/AnnotationBundle/Form/EditAnnotationType.php create mode 100644 src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php create mode 100644 src/Wallabag/AnnotationBundle/Form/RangeType.php (limited to 'src/Wallabag/AnnotationBundle/Form') diff --git a/src/Wallabag/AnnotationBundle/Form/EditAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/EditAnnotationType.php new file mode 100644 index 00000000..3b587478 --- /dev/null +++ b/src/Wallabag/AnnotationBundle/Form/EditAnnotationType.php @@ -0,0 +1,18 @@ +add('text', null, [ + 'empty_data' => '', + ]) + ; + } +} diff --git a/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php new file mode 100644 index 00000000..c73c3ded --- /dev/null +++ b/src/Wallabag/AnnotationBundle/Form/NewAnnotationType.php @@ -0,0 +1,35 @@ +add('text', null, [ + 'empty_data' => '', + ]) + ->add('quote', null, [ + 'empty_data' => null, + ]) + ->add('ranges', CollectionType::class, [ + 'entry_type' => RangeType::class, + 'allow_add' => true, + ]) + ; + } + + public function configureOptions(OptionsResolver $resolver) + { + $resolver->setDefaults([ + 'data_class' => Annotation::class, + ]); + } +} diff --git a/src/Wallabag/AnnotationBundle/Form/RangeType.php b/src/Wallabag/AnnotationBundle/Form/RangeType.php new file mode 100644 index 00000000..0647375e --- /dev/null +++ b/src/Wallabag/AnnotationBundle/Form/RangeType.php @@ -0,0 +1,19 @@ +add('start') + ->add('startOffset') + ->add('end') + ->add('endOffset') + ; + } +} -- cgit v1.2.3