This commit is contained in:
Barış Soner Uşaklı
2015-09-15 12:58:19 -04:00
parent 4acb31839e
commit 5b08538264
3 changed files with 14 additions and 0 deletions

View File

@@ -68,6 +68,9 @@ module.exports = function(Categories) {
}
function updateParent(cid, newParent, callback) {
if (parseInt(cid, 10) === parseInt(newParent, 10)) {
return callback(new Error('[[error:cant-set-self-as-parent]]'));
}
Categories.getCategoryField(cid, 'parentCid', function(err, oldParent) {
if (err) {
return callback(err);