Uploaded image for project: 'Magnolia Personalization'
  1. Magnolia Personalization
  2. MGNLPN-502

Previewing traits Using MultiValue Fields Give ClassCastException

    XMLWordPrintable

Details

    Description

      There is an issue with MultiValue fields being used within traits and the Preview App. User receives following error when adding a value to the field:

      Failed to dispatch context property change: java.util.LinkedHashMap cannot be cast to javax.jcr.Node
      java.lang.ClassCastException: java.util.LinkedHashMap cannot be cast to javax.jcr.Node
      

      I have tested this on 6.1 and 6.2 and had different results. With 6.1 , I was able to add more Items to my MultiValue field and had no errors. On 6.2, I used two different configurations, one was with the old MultiValue names (i.e.info.magnolia.ui.form.field.definition.MultiValueFieldDefinition) and its respective configs, the other was with info.magnolia.ui.field.JcrMultiFieldDefinition.

      With the older config, I was able to add more Items to my list, but the above error kept showing. When using the new class name (JcrMultFieldDefinition), the error showed as well.

      I have attached the configs I have used for both 6.1 and 6.2 along with their converter, voter and trait class.

       

      Dev notes

      We could bind to this map via JCR API - expose map as a mocked JCR node instead of LinkedHashMap 

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                ajuran AntonĂ­n Juran
                jnodarse Julian Nodarse
                Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD

                    Time Tracking

                      Estimated:
                      Original Estimate - Not Specified
                      Not Specified
                      Remaining:
                      Time Spent - 1d 3.4h Remaining Estimate - 7m
                      7m
                      Logged:
                      Time Spent - 1d 3.4h Remaining Estimate - 7m
                      1d 3.4h