Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20190121.sql =================================================================== diff -u --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20190121.sql (revision 0) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/dbupdates/patch20190121.sql (revision 04323e8f7840980eeb50f8ce5f6a6dc718b55ddb) @@ -0,0 +1,14 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-4756 Unable to add attachments in Forum +UPDATE lams_cr_credential set name = "forum" where name = "forumw"; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml =================================================================== diff -u -rb71c9cb2f96eb891545d32aaca8904051d1e00d5 -r04323e8f7840980eeb50f8ce5f6a6dc718b55ddb --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml (.../forumApplicationContext.xml) (revision b71c9cb2f96eb891545d32aaca8904051d1e00d5) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/forumApplicationContext.xml (.../forumApplicationContext.xml) (revision 04323e8f7840980eeb50f8ce5f6a6dc718b55ddb) @@ -73,7 +73,7 @@ forumworkspace - forumw + forum lams-forum Index: lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/model/Message.java =================================================================== diff -u -r1ee503e3d0e0228ea8a45025fddf15d9623c0377 -r04323e8f7840980eeb50f8ce5f6a6dc718b55ddb --- lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/model/Message.java (.../Message.java) (revision 1ee503e3d0e0228ea8a45025fddf15d9623c0377) +++ lams_tool_forum/src/java/org/lamsfoundation/lams/tool/forum/model/Message.java (.../Message.java) (revision 04323e8f7840980eeb50f8ce5f6a6dc718b55ddb) @@ -170,6 +170,7 @@ while (iter.hasNext()) { Attachment file = (Attachment) iter.next(); Attachment newFile = (Attachment) file.clone(); + newFile.setMessage(msg); // attachment 'owns' the relationship // use common file node in repository set.add(newFile); }