Fix an issue when cleaning the template category in the drive

This commit is contained in:
yflory 2017-09-12 11:29:24 +02:00
parent 0f9da69185
commit 63700cb791
1 changed files with 7 additions and 4 deletions

View File

@ -1014,7 +1014,7 @@ define([
var toClean = [];
us.forEach(function (el, idx) {
if (!isFile(el, true) || rootFiles.indexOf(el) !== -1) {
toClean.push(idx);
toClean.push(el);
}
if (typeof el === "string") {
// We have an old file (href) which is not in filesData: add it
@ -1026,12 +1026,15 @@ define([
var data = files[FILES_DATA][el];
if (!data) {
debug("An element in TEMPLATE doesn't have associated data", el);
toClean.push(idx);
toClean.push(el);
}
}
});
toClean.forEach(function (idx) {
us.splice(idx, 1);
toClean.forEach(function (el) {
var idx = us.indexOf(el);
if (idx !== -1) {
us.splice(idx, 1);
}
});
};
var migrateAttributes = function (el, id, parsed) {