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:
18
18
19
19
script :
20
20
- 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 26
26
"paulzi/yii2-adjacency-list" : " ^2.0"
27
27
},
28
28
"require-dev" : {
29
- "friendsofphp/php-cs-fixer" : " ~2.0"
29
+ "friendsofphp/php-cs-fixer" : " ~2.0" ,
30
+ "phpunit/phpunit" : " ~6.0"
30
31
},
31
32
"autoload" : {
32
33
"psr-4" : {
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ public static function find()
168
168
public function beforeSave ($ insert )
169
169
{
170
170
if (parent ::beforeSave ($ insert )) {
171
- if ($ this ->parentId > 0 ) {
171
+ if ($ this ->parentId > 0 && $ this -> isNewRecord ) {
172
172
$ parentNodeLevel = static ::find ()->select ('level ' )->where (['id ' => $ this ->parentId ])->scalar ();
173
173
$ this ->level += $ parentNodeLevel ;
174
174
}
You can’t perform that action at this time.
0 commit comments