4.2.c regression on custom constraint

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2013 05:44 AM
It was running fine in 4.2.b and before but ends up giving me trouble in 4.2.c
The error happens when looking at the "Workflow Details" of a workflow containing a field based on that constraint.
I get a simple "Failure" popup and a log message including:
Caused by: java.lang.NullPointerException at org.alfresco.web.scripts.forms.FormUIGet.processFieldConstraintControl(FormUIGet.java:1956)
The problem seems to be that fieldConfig is null.
Previous version of the file didn't include this check using fieldConfig hence didn't trigger the bug.
The following changed the 7th of december in commit 44483 in the file org.alfresco.web.scripts.forms.FormUIGet.java by replacing
Collections.sort(optionsList, new OptionsComparator());
with
if (fieldConfig.isSorted()){ Collections.sort(optionsList, new OptionsComparator());}
I don't really know what this fieldConfig corresponds to and if the spec marks it as mandatory (I tend to believe it's not since a check on it is made a few lines before) so I didn't report it on jira just yet.
PS: Removing the check altogether isn't an option since it would bring back this bug: https://issues.alfresco.com/jira/browse/ALF-16157
- Labels:
-
Archive
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2013 03:42 AM
It appears that 4.2.c cannot handle any reference to a custom constraint. My exception chain looks the same. Going back to 4.2.b instantly resolved the issue.
It is frustrating and immensely time consuming that such basic things dont work!!!
-Armin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-09-2013 04:18 PM
<config evaluator="string-compare" condition="your_condition"> <forms> <form> <appearance> <field id="the_field_using_the_constraint"></field> </appearance> </form> </forms> </config>
It seems that just having the field defined in the form config is enough to make sure that the FormField object is not null, and the NPE goes away.
Hope it works for you

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2013 02:27 AM
Yes I came up with the same workaround,
I signaled it on another forum thred that was created on the same issue short after this one (http://forums.alfresco.com/comment/129477#comment-129477) but forgot to report it here as well.
Thanks for your input.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2013 11:53 AM
An error has occured in the Share component: /share/service/components/form.It responded with a status of 500 - Internal Error.Error Code Information: 500 - An error inside the HTTP server which prevented it from fulfilling the request.Error Message: 03100006 Wrapped Exception (with status template): nullServer: Alfresco Spring WebScripts - v1.2.0 (Release 1207) schema 1.000Time: 10-apr-2013 15.51.46Click here to view full technical information on the error.Exception: org.springframework.extensions.webscripts.WebScriptException - 03100006 Wrapped Exception (with status template): nullorg.springframework.extensions.webscripts.AbstractWebScript.createStatusException(AbstractWebScript.java:1067)
it's possible solve the problem?
The solution of nmcminn not work!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2014 03:08 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2014 04:28 AM
The idea behind this workaround is that if you redefine the form fields explicitly, the NPE will disappear.
Please refer to http://wiki.alfresco.com/wiki/Forms to configure forms in share.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2014 07:12 AM
You mean that I should not rely on the automatic form generation and explicitly define a creation/modification form for custom type(s) relying on LIST constraint ?
I added
<code lang="xml">
<config evaluator="string-compare" condition="your_condition">
<forms>
<form>
<appearance>
<field id="ag:documentNature"></field>
</appearance>
</form>
</forms>
</config>
</code>
in share-config-custom.xml and it doesn't correct the NPE.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-18-2014 09:10 AM
Yes. For this specific version of Alfresco, a bug forces you to redefine the form instead of relying on the automatic one when you have a custom list constraint.
I'd like to avoid giving you just the snippet of code because otherwise you'll just paste it and forget about it and it might cause you trouble with future customisation.
Basically the part that is wrong here is your first line where "your_condition" should obviously be replace by something that is specific to your actual model.
And actually, if you read the link I sent you, you'll more often see examples using
<config evaluator="node-type" condition="your_condition">
Good luck with your customisation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2014 12:01 PM
<config evaluator="string-compare" condition="activiti$activitiCreateEvenement"> <forms> <form> <appearance> <field id="wfevt:theme1" /> <field id="wfevt:theme2" /> </appearance> </form> </forms> </config>
to no joy I'm afraid. I still get the null error. I hope to be able to solve this soon because it's eating my day.
Will post back if I do. In the mean time if anyone has any ideas, I'd be happy to receive them. I'm working in a 4.2.c maven build
