From 9ac0b5757ce55cd650eeacdd74d76bf48c47303c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Jun 2015 13:32:34 +0300 Subject: [PATCH 1/2] Deprecated notice fix (prevents behat from stopping) --- Form/Extension/FormExtension.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Form/Extension/FormExtension.php b/Form/Extension/FormExtension.php index 21bd7b9..3b40913 100644 --- a/Form/Extension/FormExtension.php +++ b/Form/Extension/FormExtension.php @@ -5,7 +5,7 @@ use Fp\JsFormValidatorBundle\Form\Subscriber\SubscriberToQueue; use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormBuilderInterface; -use Symfony\Component\OptionsResolver\OptionsResolverInterface; +use Symfony\Component\OptionsResolver\OptionsResolver; /** * Class FormExtension @@ -39,7 +39,7 @@ public function buildForm(FormBuilderInterface $builder, array $options) /** * @param OptionsResolverInterface $resolver */ - public function setDefaultOptions(OptionsResolverInterface $resolver) + public function configureOptions(OptionsResolver $resolver) { $resolver->setDefaults(array('js_validation' => true)); } @@ -53,4 +53,4 @@ public function getExtendedType() { return 'form'; } -} \ No newline at end of file +} From dd2fb9f47ced02ba60506dcb10dcef89d0239646 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Jun 2015 13:38:38 +0300 Subject: [PATCH 2/2] Error path for repeated element (fails custom showError otherwise) --- Resources/public/js/FpJsFormValidator.js | 3 +++ Resources/public/js/fp_js_validator.js | 3 +++ 2 files changed, 6 insertions(+) diff --git a/Resources/public/js/FpJsFormValidator.js b/Resources/public/js/FpJsFormValidator.js index 2f346aa..cc4dfee 100644 --- a/Resources/public/js/FpJsFormValidator.js +++ b/Resources/public/js/FpJsFormValidator.js @@ -807,6 +807,9 @@ var FpJsFormValidator = new function () { * @param {FpJsFormElement} element */ this.getErrorPathElement = function (element) { + if (element.type == 'repeated') { + return this.findDomElement({id: element.id+'_first', name: element.name+'_first'}).jsFormValidator; + } if (!element.bubbling) { return element; } else { diff --git a/Resources/public/js/fp_js_validator.js b/Resources/public/js/fp_js_validator.js index d362486..5d002f1 100755 --- a/Resources/public/js/fp_js_validator.js +++ b/Resources/public/js/fp_js_validator.js @@ -807,6 +807,9 @@ var FpJsFormValidator = new function () { * @param {FpJsFormElement} element */ this.getErrorPathElement = function (element) { + if (element.type == 'repeated') { + return this.findDomElement({id: element.id+'_first', name: element.name+'_first'}).jsFormValidator; + } if (!element.bubbling) { return element; } else {