Uploaded image for project: 'eZ Platform Enterprise Edition'
  1. eZ Platform Enterprise Edition
  2. EZEE-2624

Form Builder number field fails when min and/or max value set

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: 2.3.2
    • Fix Version/s: 2.4.0, 2.3.3
    • Component/s: Form Builder
    • Labels:
      None

      Description

      As a user I would expect to be able to enter min and max values for the fields exposed in the form editing view of the "number" field type.

      However when I do enter the values and store the values, I am presented the following error page:

      Type error: Argument 1 passed to EzSystems\EzPlatformFormBuilder\Form\Validator\Constraints\MaxValue::__construct() must be of the type float or null, string given, called in /Users/janit/Sites/foobar/vendor/ezsystems/ezplatform-form-builder/src/lib/Form/Mapper/FieldValidator/GenericFieldValidatorConstraintMapper.php on line 50
      

      The reason seems to be that the system expects either a null of float value for MinValue and MaxValue items, but in the constructor the passed value is passed as a string ( '1337' vs 1337 ):

      MaxValue->__construct('1337')
      in vendor/ezsystems/ezplatform-form-builder/src/lib/Form/Mapper/FieldValidator/GenericFieldValidatorConstraintMapper.php (line 50)
      

      How to reproduce:

      1. Install eZ Platform EE
      2. Create Form
      3. Add number field to form
      4. Close form and save object
      5. Everything works as expected
      6. Reopen editing and proceed to edit form
      7. Add minimum and maximum values for field
      8. Exit form editing
      9. Observe exception mentioned above

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned
              Reporter:
              jani.tarvainen@ez.no Jani Tarvainen
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: