Enonic version: 6.14.2
OS: MacOS/Linux
Hi there,
I faced the issue with saving modified data. I’m confused because of the error message FormItem [] in [skills] is not of type Input: com.enonic.xp.form.FieldSet
on the other hand if I do make changes in content studio, there are no problems. Could you point me to where I could be wrong.
upd2: No, the issue is still there.
update profile snippet
var profile = libs.content.get({key: req.params.id});
var updateData = getDataToModify(req.params);
var fnEditor = function (u) {
var p = req.params;
u.data = profile.data;
for ( var key in updateData ) {
u.data[key] = updateData[key];
}
u.modifiedTime = new Date().toISOString();
return u;
};
var response = blackProf.editProfile(profile, fnEditor);
function modifyProfile(profile, fnEditor) {
var result = runAsAdmin( function() {
return libs.content.modify({
key: profile._id,
editor: fnEditor,
branch: 'draft'
});
});
return result;
}
xml skill snippet
Select skills Skills info false <options minimum="0" maximum="5">
<option name="langSkills">
<label i18n="skills.lang-skills.label">Languages</label>
<items>
<item-set name="langSkillSelector">
<label>Programming Languages</label>
<items>
<input name="skillNode" type="ContentSelector">
<label i18n="skills.select-skill.label">Select Language</label>
<occurrences minimum="1" maximum="1" />
<config>
<relationshipType>system:reference</relationshipType>
<allowContentType>skill</allowContentType>
<allowPath>${site}/skills/languages/</allowPath>
</config>
</input>
<inline mixin="skill-attributes"/>
</items>
<occurrences minimum="0" maximum="0"/>
</item-set>
</items>
</option>
…
part of error listing
2018-05-29 12:44:56,085 ERROR c.e.x.p.i.e.ExceptionRendererImpl - FormItem [] in [skills] is not of type
Input: com.enonic.xp.form.FieldSet
com.enonic.xp.web.WebException: FormItem [] in [skills] is not of type Input: com.enonic.xp.form.FieldSet
at com.enonic.xp.web.impl.exception.ExceptionMapperImpl.map(ExceptionMapperImpl.java:32)
at com.enonic.xp.portal.handler.BasePortalHandler.handleError(BasePortalHandler.java:62)
at com.enonic.xp.portal.handler.BasePortalHandler.doHandle(BasePortalHandler.java:54)
at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:66)
at com.enonic.xp.web.impl.handler.WebHandlerChainImpl.handle(WebHandlerChainImpl.java:30)
at com.enonic.xp.web.impl.trace.TraceWebFilter.doHandle(TraceWebFilter.java:37)
at com.enonic.xp.web.handler.BaseWebHandler.handle(BaseWebHandler.java:66)
at com.enonic.xp.web.impl.handler.WebHandlerChainImpl.handle(WebHandlerChainImpl.java:30)
at com.enonic.xp.web.impl.handler.WebDispatcherImpl.dispatch(WebDispatcherImpl.java:50)
at com.enonic.xp.web.impl.handler.WebDispatcherServlet.doHandle(WebDispatcherServlet.java:135)
at com.enonic.xp.web.impl.handler.WebDispatcherServlet.service(WebDispatcherServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at com.enonic.xp.web.impl.dispatch.mapping.ServletDefinitionImpl.service(ServletDefinitionImpl.java:39)
at com.enonic.xp.web.impl.dispatch.pipeline.ServletPipelineImpl.service(ServletPipelineImpl.java:30)
at com.enonic.xp.web.impl.dispatch.pipeline.FilterChainImpl.doFilter(FilterChainImpl.java:45)
at com.enonic.xp.web.impl.dispatch.pipeline.FilterChainImpl.doFilter(FilterChainImpl.java:36)
at com.enonic.xp.portal.impl.auth.AuthFilter.doHandle(AuthFilter.java:45)
at com.enonic.xp.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:31)
at com.enonic.xp.web.filter.BaseWebFilter.doFilter(BaseWebFilter.java:33)
...
I admitted if the structure of xml was wrong I wouldn’t be able to create new objects in content studio.
On the other hand, If the object (profile) has no skills selected, it can be modified well using the functions listed above. But once I add skills in content studio and then do content.modify – it gives me this error.
Could you help me please?
Thanks in advance.