-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with createFromArray method #242
Comments
Hello, @alexbabich1990! I'll try to look closer into it this week or so. |
Hello again ;). I use your package in my project and i have unit tests for testing. After upgrading the "franzose/ClosureTable" package to ^6, I have couple errors. I updated the franzose/closure-table/src/Models/Entity.php file and now everything works correctly for me. What i changed: i updated:
to
Than i updated:
to: public function moveTo($position, $ancestor = null)
And i added your old method from L5.4 version.
Maybe I made a mistake somewhere, but my functionality works correctly for me. Could you please check it and update when you have some free time? |
Hello
Hello, i updated the "franzose/ClosureTable" package to ^6 version.
I noted one problem, if i use createFromArray() method for creating tree, position always change.
For example:
$array = [
[
'id' => 1,
'title' => 'Much Very White',
'position' => 0,
'url' => 'color-tree',
],
[
'id' => 2,
'title' => 'Car tree',
'url' => 'car-tree',
'position' => 1,
],
[
'id' => 3,
'title' => 'Country tree',
'url' => 'country-tree',
'position' => 2
],
];
After using createFromArray() method i got:
[
'id' => 1,
'title' => 'Much Very White',
'position' => 2,
'url' => 'color-tree',
],
[
'id' => 2,
'title' => 'Car tree',
'url' => 'car-tree',
'position' => 0,
],
[
'id' => 3,
'title' => 'Country tree',
'url' => 'country-tree',
'position' => 1
],
I mean, the position field on all points was changed.
if i update vendor/franzose/closure-table/src/Models/Entity.php
to
after that createFromArray() method works correct for me.
Could you please check it?
The text was updated successfully, but these errors were encountered: