[MGNLUI-5884] Slider Field and Contenttype definition Created: 20/May/20  Updated: 30/Sep/21  Resolved: 30/Sep/21

Status: Closed
Project: Magnolia UI
Component/s: None
Affects Version/s: 6.2.1
Fix Version/s: None

Type: Bug Priority: Neutral
Reporter: Mercedes Iruela Assignee: Unassigned
Resolution: Obsolete Votes: 0
Labels: y2k
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

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.



 Comments   
Comment by Marta Kobus [ 30/Sep/21 ]

Hello,

This ticket is now marked as closed due to one of the following reasons:

  • A long period of inactivity
  • Uses an old or Beta version of an application, module, or framework that we no longer support
  • The issue is no longer reproducible or has been fixed in later versions

If you are still facing a problem or consider this issue still relevant, please feel free to re-open the ticket and we will reach out to you.

 

Thank you,

The Magnolia Team

Generated at Mon Feb 12 09:31:00 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.