RWS / dxa-web-application-java

SDL Digital Experience Accelerator Java Spring MVC web application
25 stars 37 forks source link

Incorrect XPM Component field markup when 2+ levels of multivalue embedded fields #105

Open willprice76 opened 6 years ago

willprice76 commented 6 years ago

If you have a content model which uses 2 levels of multivalue embedded fields (for example schema Article contains multival embedded field Paragraph, which contains multivalue embedded field Link) then the XPM markup generated for the fields within the lowest level is incorrect:

<!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:paragraph[2]/custom:link[1]/custom:link/custom:linkText[1]"} -->

instead of

<!-- Start Component Field: {"XPath":"tcm:Content/custom:Article/custom:paragraph[2]/custom:link[1]/custom:linkText[1]"} -->

willprice76 commented 6 years ago

I suspect the logic in FieldPath is incorrect somewhere around here: https://github.com/sdl/dxa-web-application-java/blob/58a4fdebafc192b9a87570c684bd97d9091fdc5f/dxa-framework/dxa-common/src/main/java/com/sdl/webapp/common/api/mapping/semantic/config/FieldPath.java#L63