mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-14 17:58:59 +00:00
Merged V1.3 to HEAD (3106:3116)
svn merge svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3106 svn://www.alfresco.org:3691/alfresco/BRANCHES/V1.3@3116 . git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@3401 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -831,7 +831,8 @@ public class CheckinCheckoutBean
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
tx = Repository.getUserTransaction(FacesContext.getCurrentInstance());
|
FacesContext context = FacesContext.getCurrentInstance();
|
||||||
|
tx = Repository.getUserTransaction(context);
|
||||||
tx.begin();
|
tx.begin();
|
||||||
|
|
||||||
if (logger.isDebugEnabled())
|
if (logger.isDebugEnabled())
|
||||||
@@ -839,6 +840,11 @@ public class CheckinCheckoutBean
|
|||||||
|
|
||||||
// get an updating writer that we can use to modify the content on the current node
|
// get an updating writer that we can use to modify the content on the current node
|
||||||
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
|
ContentWriter writer = this.contentService.getWriter(node.getNodeRef(), ContentModel.PROP_CONTENT, true);
|
||||||
|
|
||||||
|
// also update the mime type in case a different type of file is uploaded
|
||||||
|
String mimeType = Repository.getMimeTypeForFileName(context, this.fileName);
|
||||||
|
writer.setMimetype(mimeType);
|
||||||
|
|
||||||
writer.putContent(this.file);
|
writer.putContent(this.file);
|
||||||
|
|
||||||
// commit the transaction
|
// commit the transaction
|
||||||
|
Reference in New Issue
Block a user