Skip to content

Commit 1171623

Browse files
Merge pull request #2535 from adaptlearning/issue/#2534
Assign correct parentId to courseasset on clone item
2 parents 91fe21f + 86dc58b commit 1171623

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

frontend/src/modules/scaffold/views/scaffoldListView.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ define([
9797
var flatItem = Helpers.flattenNestedProperties(this.editor.value);
9898
var itemValues = _.values(flatItem);
9999
var parentAttributes = Origin.scaffold.getCurrentModel().attributes;
100+
var parentId = parentAttributes._type === 'course' ? parentAttributes._id : parentAttributes._parentId;
100101
itemValues.forEach(function(item) {
101102
if (typeof item !== 'string' || item.indexOf('course/assets') === -1) return;
102103

@@ -112,7 +113,7 @@ define([
112113
_contentTypeId : parentAttributes._id,
113114
_fieldName : itemFileName,
114115
_assetId : result[0]._id,
115-
_contentTypeParentId: parentAttributes._parentId
116+
_contentTypeParentId: parentId
116117
}, {
117118
error: function(error) {
118119
Origin.Notify.alert({

0 commit comments

Comments
 (0)