|
@@ -102,9 +102,9 @@ class Category extends Backend |
|
@@ -102,9 +102,9 @@ class Category extends Backend |
102
|
$params = $this->preExcludeFields($params);
|
102
|
$params = $this->preExcludeFields($params);
|
103
|
|
103
|
|
104
|
if ($params['pid'] != $row['pid']) {
|
104
|
if ($params['pid'] != $row['pid']) {
|
105
|
- $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id']);
|
105
|
+ $childrenIds = Tree::instance()->init(collection(\app\common\model\Category::select())->toArray())->getChildrenIds($row['id'], true);
|
106
|
if (in_array($params['pid'], $childrenIds)) {
|
106
|
if (in_array($params['pid'], $childrenIds)) {
|
107
|
- $this->error(__('Can not change the parent to child'));
|
107
|
+ $this->error(__('Can not change the parent to child or itself'));
|
108
|
}
|
108
|
}
|
109
|
}
|
109
|
}
|
110
|
|
110
|
|