Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-5884

Slider Field and Contenttype definition

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Neutral Neutral
    • None
    • 6.2.1
    • None

      If I use a Slider field in a content app and define a content type for this content, I get an error if I set the content-type type as Double and also if I use the default configuration.

      Steps to reproduce

      1. Create a content app and the content-type definition(yaml files attached):
        App definition
        !content-type:news
        name: News 2
        subApps:
          detail:
            form:
              properties: !override
                jcrName:
                order:
                  $type: sliderField
                  defaultValue: 50
        
        Content type definition
        datasource:
          workspace: news
          rootPath: /
          autoCreate: true
        model:
          nodeType: mgnl:news
          properties:
            - name: order
            - type: Double
        
      1. Open the new content app and try to change the slider. And error comes up.

      Expected result

      Slider is working and the value can be changed and saved

      Actual result

      An error comes up:

      Message: java.lang.String cannot be cast to java.lang.Double. Stack trace: 
      java.lang.ClassCastException: java.lang.String cannot be cast to java.lang.Double
      

      Workaround

      • do not specify the type in the content type definition, just to use the default one.
      • add property type: java.lang.Double in the slider field definition

      Development notes

      JCR form binding mechanism should do auto-conversion for the primitive types, but it seems not happening in this case.

        Acceptance criteria

              Unassigned Unassigned
              miruela Mercedes Iruela
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD