We're updating the issue view to help you get more done. 

Multiple jcr:content in the PagePersistenceStrategy

Description

Configurations:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 @Configuration( label = "Footer Configuration", description = "Add footer navigation, footer branding and social configuration" ) public @interface FooterConfig { @Property( label = "Navigational menu's", description = "Define multiple menu's which usually will be rendered in order of definition. Please note that configuration and rendering are not necessarily a 1-on-1 match", order = 200 ) MenuConfig[] menu(); } public @interface MenuConfig { @Property(label = "Links", description = "Configure a list of links") MenuLinkConfig[] links(); } public @interface MenuLinkConfig { @Property( label = "Link Text", description = "Configure a link text, when this is available, this will receive preference over nav and page title [Optional]", order = 200 ) String linkText(); @Property( label = "Link", description = "Configure the link to an internal page via the path browser or enter an absolute URL [Optional]", property = { "widgetType=pathbrowser", "pathbrowserRootPath=/content" }, order = 300 ) String link(); }

Using this configuration in combination with the page persistence strategy will yield 'no context path available' errors because the getCollectionItemConfigName from the page persistence strategy adds jcr:content when it wasn't supposed to.
You get faulty links like ...FooterConfig/jcr:content/menu/menu1/jcr:content/links instead of ..FooterConfig/jcr:content/menu/menu1/links where it's actually persisted and thus triggering these kind of issues. Changing the getCollectionItemConfigName in the PagePersistenceStrategy to the code below seems to fix that issue.

1 2 3 public String getCollectionItemConfigName(@NotNull String configName, @Nullable String relatedConfigPath) { return !enabled ? null : configName; }

Environment

None

Status

Assignee

Stefan Seifert

Reporter

Bart Wulteputte

Labels

None

Components

Priority

Minor