Open antonkomarev opened 5 years ago
Strange, I ran the test before making the PR. I'll try to find some time to look into it this week-end.
Could the issue be related to the laravel version ? Because I tried with php 5.6 and 7.2 without issue
I have the same issue with laravel 5.7.22
The bug seems to stem from the inner Eloquent handling of Model-properties.
If I simply add a $parentNode->ancestors;
call in my code, after the $parentNode->appendNode($node);
call, the bug seems to be worked around regarding ancestors. But how this should be implemented in the NodeTrait, so that Capsule::table('menu_items')->insert($data);
will make the test succeed, I am very unsure of.
I have provided a fix for this in my fork: https://github.com/Ciaro/laravel-nestedset/commits/fix-scoped-relationships: have a look and see if it fixes the issue for you :)
@Ciaro that's better to post as PR in this repository.
@antonkomarev Hi, I prepared a PR for this. This will however require a new v5 cause of the BC towards lower Laravel versions.
PHP 7.1.26 Laravel 5.7.19 Branch v4 (as it seems to be the latest one)
Possibly related to PR #315
I just cloned your repo, made
composer install
and executedvendor/bin/phpunit
.