File tree Expand file tree Collapse file tree 3 files changed +4
-3
lines changed
Expand file tree Collapse file tree 3 files changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -18,4 +18,4 @@ install:
1818
1919script :
2020 - vendor/friendsofphp/php-cs-fixer/php-cs-fixer fix --dry-run --diff
21- - phpunit --verbose
21+ - vendor/bin/ phpunit --verbose
Original file line number Diff line number Diff line change 2626 "paulzi/yii2-adjacency-list" : " ^2.0"
2727 },
2828 "require-dev" : {
29- "friendsofphp/php-cs-fixer" : " ~2.0"
29+ "friendsofphp/php-cs-fixer" : " ~2.0" ,
30+ "phpunit/phpunit" : " ~6.0"
3031 },
3132 "autoload" : {
3233 "psr-4" : {
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ public static function find()
168168 public function beforeSave ($ insert )
169169 {
170170 if (parent ::beforeSave ($ insert )) {
171- if ($ this ->parentId > 0 ) {
171+ if ($ this ->parentId > 0 && $ this -> isNewRecord ) {
172172 $ parentNodeLevel = static ::find ()->select ('level ' )->where (['id ' => $ this ->parentId ])->scalar ();
173173 $ this ->level += $ parentNodeLevel ;
174174 }
You can’t perform that action at this time.
0 commit comments