Sfoglia il codice sorgente

Fix missing bit in the InlineConstraint migration

Thomas Rabaix 10 anni fa
parent
commit
fc2219a681

+ 7 - 0
Validator/Constraints/InlineConstraint.php

@@ -17,4 +17,11 @@ use Sonata\CoreBundle\Validator\Constraints\InlineConstraint as BaseInlineConstr
  */
 class InlineConstraint extends BaseInlineConstraint
 {
+    /**
+     * {@inheritDoc}
+     */
+    public function validatedBy()
+    {
+        return 'sonata.admin.validator.inline';
+    }
 }

+ 15 - 1
Validator/InlineValidator.php

@@ -11,11 +11,25 @@
 namespace Sonata\AdminBundle\Validator;
 
 use Sonata\CoreBundle\Validator\InlineValidator as BaseInlineValidator;
+use Sonata\AdminBundle\Validator\ErrorElement;
 
 /**
  * @deprecated
  */
 class InlineValidator extends BaseInlineValidator
 {
-
+    /**
+     * @param mixed $value
+     *
+     * @return ErrorElement
+     */
+    protected function getErrorElement($value)
+    {
+        return new ErrorElement(
+            $value,
+            $this->constraintValidatorFactory,
+            $this->context,
+            $this->context->getGroup()
+        );
+    }
 }