create-item message should mark references dirty
This commit is contained in:
@@ -478,7 +478,7 @@ class ComponentManager {
|
||||
item.setDomainDataItem(component.url || component.uuid, responseItem.clientData, ClientDataDomain);
|
||||
}
|
||||
this.modelManager.addItem(item);
|
||||
this.modelManager.resolveReferencesForItem(item);
|
||||
this.modelManager.resolveReferencesForItem(item, true);
|
||||
item.setDirty(true);
|
||||
this.syncManager.sync("handleCreateItemMessage");
|
||||
this.replyToMessage(component, message, {item: this.jsonForItem(item, component)})
|
||||
|
||||
@@ -296,7 +296,7 @@ class ModelManager {
|
||||
this.addItems([item]);
|
||||
}
|
||||
|
||||
resolveReferencesForItem(item) {
|
||||
resolveReferencesForItem(item, markReferencesDirty = false) {
|
||||
|
||||
var contentObject = item.contentObject;
|
||||
|
||||
@@ -313,6 +313,10 @@ class ModelManager {
|
||||
if(referencedItem) {
|
||||
item.addItemAsRelationship(referencedItem);
|
||||
referencedItem.addItemAsRelationship(item);
|
||||
|
||||
if(markReferencesDirty) {
|
||||
referencedItem.setDirty(true);
|
||||
}
|
||||
} else {
|
||||
// console.log("Unable to find reference:", reference.uuid, "for item:", item);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user