cancel
Showing results for 
Search instead for 
Did you mean: 

Create Web Content persists field values

steventux
Champ in-the-making
Champ in-the-making
Using WCM in Alfresco Labs 3.0, using Firefox 2.0.0.16 on Linux 2.6 kernel.
I create an article (using article.xsd from ${ALFRESCO_HOME}/extras/wcm/contentmodels) complete editorial process and click finish. Then create another article with different copy entered, click next or finish and previous article's copy is inserted into second piece's xml and subsequent renditions (!)
This seems like a session-based and not a browser bug persisting these values between screens? Bit of a show-stopper, can confirm logging out between creating pieces of content gets around the problem.
5 REPLIES 5

steventux
Champ in-the-making
Champ in-the-making
Further investigation shows that the mootools XMLHTTP request http://<host>:<port>/alfresco/ajax/invoke/XFormsBean.getXForm retrieves the previous form's values, so basically on step 2 of the WCM create web content wizard, this call loads the previous values. <Sound of toys being thrown out of pram> gonna test with IE and Vista will post findings.
Also tested against SVN build and same results - the wrong XML file is referenced in the completion screen (always the previous xml file).

sol1
Champ in-the-making
Champ in-the-making
Hi steventux,

we experienced the same problem. There is already a fix for this problem, but you will find it under a diffrent topic. See: https://issues.alfresco.com/jira/browse/ALFCOM-727

In class XFormsProcessor (path: projects/web-client/source/java/org/alfresco/web/forms/xforms ) you have to add the serialze.js to the final static JS_SCRIPTS array.


      "/scripts/ajax/dojo/src/date/serialize.js"

Kind regards.

steventux
Champ in-the-making
Champ in-the-making
Many thanks for the info, this fixed the problem of content being overwritten by previous item.
I rebuilt web-client jar with this change and the content is correct in XML and renditions although on the 'finalize' screen the wrong XML path/filename is still displayed.
Editing various content types still gives the error  
java.lang.IllegalArgumentException: instance document root tag name invalid. expected x:x, got y:y
so something still being held in session. This isn't such a problem right now but suspect the 'x:x' schema is persisting in session somehow.
Thanks Again
Steve

After a bit more digging, I can see that the formInstanceData value coming back from the ValueBindingImpl is 'stale'. I can't find where this is populated in the first place or the correct place to overwrite or unset it. Some of the connecting code (e.g. UIFormProcessor.java) has Ariel Backenroth's name on it - please don't consider that mudslinging but if you're reading this maybe you can shed more light?

paavo
Champ in-the-making
Champ in-the-making
My fix to this was to add

this.instanceDataDocument = null;
to public String cancel() and protected String finishImpl(final FacesContext context, String outcome) in projects/web-client/source/java/org/alfresco/web/bean/wcm/CreateWebContentWizard.java.

That seems to have fixed it, but I would like to hear from someone (from Alfresco) if this is likely to break something else that I haven't noticed yet.

p

steventux
Champ in-the-making
Champ in-the-making
Thanks Paavo this works for me - no longer get unexpected root element error messages when using different WCM forms to create content.  Smiley Very Happy
As you mention it would be good for someone at Alfresco to look into the implications of this change. They could even integrate the fix into SVN for us.