-
Notifications
You must be signed in to change notification settings - Fork 460
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
makeRoot() fails on already existing items #64
Comments
From what I can deduce of the error the table has null values for the As you say you already had that table in place and you added the necessary columns, try to run |
Is this still happening? |
Hey, no you can close it. Probably it was my fault, however I switched over to another solution. I will try it in my next project ( Baum::rebuild() ) and feed back, if it worked ;) |
Hi, the same happens to me with L5, I created a new project with Baum, but I had some problems so I removed Baum to check it in a more clean enviroment. Now after creating some tasks (is a tasks and subtasks system), I'm trying to enable the "Task extends \Baum\Node". But when for ex I try the $task->makeRoot(); i receive InvalidArgumentException in Builder.php line 457. When I try: \App\Task::rebuild;, with or without force, null return is produced, but when I do $task->save(); I've got the same error: line 457 .. .at Builder->where('lft', '<=', null) .... In the Task i've: parent_id = 0, lft,rgt,depth and path stays in null. Any Idea? Thanks in advance!, |
Solved!!!! The problem was that I've setup parent_id manually and it was not nullable. So I did the migration: Thanks for this package! |
Hello,
I have a table and want to make it a nested set table. So I added the neccessary columns and adding new elements/items to that table works really well.
However, I have to convert the already existing items to root elements. I tried the following:
However, I'm running into the following error then:
The error is clear, but I don't know how to solve it? Am I doing sth wrong? Or is there any other solution to my problem?
The text was updated successfully, but these errors were encountered: