dxa-web-application-java icon indicating copy to clipboard operation
dxa-web-application-java copied to clipboard

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

Open willprice76 opened this issue 7 years ago • 1 comments

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 avatar May 18 '18 15:05 willprice76

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

willprice76 avatar May 18 '18 15:05 willprice76