Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)

104503: Merged 5.0.N (5.0.2) to HEAD-BUG-FIX (5.1/Cloud)
      104354: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.2)
         104274: Merged DEV (4.2.5) to V4.2-BUG-FIX (4.2.5)
            102794: MNT-8678 : call to guessMimetype() on a node that has no content creates a content property
               - add check for empty content before saving a node


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@104627 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Alan Davis
2015-05-20 10:38:05 +00:00
parent 1a2b705c73
commit 5cdfb8b2f7

View File

@@ -1693,11 +1693,22 @@ public class ScriptNode implements Scopeable, NamespacePrefixResolverProvider
for (String key : this.properties.keySet())
{
Serializable value = (Serializable) this.properties.get(key);
QName qname= createQName(key);
// MNT-8678
if (ContentModel.PROP_CONTENT.equals(qname) && (value instanceof ScriptContentData))
{
ScriptContentData contentData = (ScriptContentData) value;
if (contentData.getSize() == 0)
{
continue;
}
}
// perform the conversion from script wrapper object to repo serializable values
value = getValueConverter().convertValueForRepo(value);
props.put(createQName(key), value);
props.put(qname, value);
}
this.nodeService.setProperties(this.nodeRef, props);
}