A problem with list of subconfigs

Description

Test case scenario
1 - Create a configuration in which a sub config exist. This sub-config has a list of questions, where each config is a sub-config

where Answer is a sub config itself. The thing is when we try to create a new sub-config of type Question, we first enter the title of the question, and then try to create a set of answers. If we try to save a created answer, we encounter the following error message:

The thing is this URL is called http://localhost:4502/content/website/main/_jcr_content.configData.json?configName=MainConfiguration/SubCONFIGURATION/Questions/answers&collection=true

However, the correct url should be
http://localhost:4502/content/website/main/_jcr_content.configData.json?configName=MainConfiguration/SubCONFIGURATION/Questions/q1/answers&collection=true

Activity

Show:
Stefan Seifert
April 20, 2017, 12:08 PM

in https://github.com/wcm-io/wcm-io-caconfig/commit/ed222f74b8404a974bbcfc945909df5699ea34bc i changed the exception handling in the servlet to get a better error message in this case - but the source of the problem lies in the frontend of the editor.

@david: can you have a look?

David Ding
April 27, 2017, 8:26 AM

- I'm not sure if the problem is in the frontend. It looks like the generation of the configName for a nestedConfigCollection differs from a nestedConfig:

1. Create "Sample Configuration Nested"
2. Click "EDIT" for "Sub Config 2 List".

This sends a GET request to http://localhost:4502/content/contextaware-config-sample/en/sub-page/config/_jcr_content.configData.json?configName=io.wcm.caconfig.sample.config.ConfigSampleNested/sub2List&collection=true [0]

In the response, you can see the "template" newItem - and in newItem.properties, we have:

The newItem "placeholder" segment is missing from the nestedConfigCollection configName.

After creating a new item testItem1, GETting [0] again returns with the new item in the items array, but with:

Is this a bug?

Stefan Seifert
April 27, 2017, 8:05 PM

you're right - the wrong config name path was build in the backend as well - should be fixes with this ref https://github.com/wcm-io/wcm-io-caconfig/commit/b7adc0fa5dbccf2fd1f1e2ed1ca643438a790099

please cross-check

Shady Eltobgy
April 27, 2017, 9:41 PM
Edited

Hey Stefan,

Thanks for fixing the issue. Alles ist tip-top. Everything works fine. However, it is a snapshot version. I tried the sample app and it works fine . However, In our company, we can't use a snapshot version. We must wait for an official release on maven repository. I hope this can be achieved in the coming days, because we use this library in our application.

Best regards,

Shady

Stefan Seifert
April 28, 2017, 7:21 AM

we will do a release within the next days; propably including a fix for
releases are announced on the wcm.io mailing list

Fixed

Assignee

Stefan Seifert

Reporter

Shady Eltobgy

Labels

None

Components

Affects versions

Priority

Major
Configure