Media Node duplicates With same ID when created though API
Running Umbraco 6.1.6 (Cant upgrade for another reasion)
Our video CDN provides hooks on media uploads, So I created a handler that takes that hook, creates a media node for the video, and auto populates its properies, and saves it.
I've noticed that every so often the Umbraco admin will display these automaticly created nodes mulitable times. They'll all have the same node ID, and updating one updates them all, but it still displays 3 or 4 copies of the same node in the back end, see attached picture.
Any clue why this is happening? or a way to clean up the mulitable node entries. They dont effect the front end (since every entrie shares the same ID) But makes the backend look messy.
Sure, here is the Sudo/simplified code. I've extracted a lot from this snipit. Error checking, Folder structure changing, Reading the hook from the CDN, But I don't think any of those parts are the issue.
// Set User u
umbraco.BusinessLogic.User u = new umbraco.BusinessLogic.User(0);
// Read Hook and save values into variables.
// Start at Video folder
var media = new Media(1234);
// Create Media node with Video Data
var m = Media.MakeNew(videoTitle, new MediaType(67890), u, media.Id);
// Populate new node with Post data
m.getProperty("name").Value = videoTitle;
m.getProperty("videoId").Value = videoId;
m.Save();
Media Node duplicates With same ID when created though API
Running Umbraco 6.1.6 (Cant upgrade for another reasion)
Our video CDN provides hooks on media uploads, So I created a handler that takes that hook, creates a media node for the video, and auto populates its properies, and saves it.
I've noticed that every so often the Umbraco admin will display these automaticly created nodes mulitable times. They'll all have the same node ID, and updating one updates them all, but it still displays 3 or 4 copies of the same node in the back end, see attached picture.
Any clue why this is happening? or a way to clean up the mulitable node entries. They dont effect the front end (since every entrie shares the same ID) But makes the backend look messy.
Hi Zachary
Is it possible that you can share some code? It might make it easier for people to figure out what could be the reason of the duplicates etc.
/Jan
Sure, here is the Sudo/simplified code. I've extracted a lot from this snipit. Error checking, Folder structure changing, Reading the hook from the CDN, But I don't think any of those parts are the issue.
Fixed problem by adding a pause in the handler between when the node was created/populated, and then saved.
is working on a reply...