Still receiving node error
Closed this issue · 11 comments
After updating to latest settled OctoberCMS build (107) and updating your plugin to v1.0.5, I'm still getting the error:
A node cannot be moved to a descendant of itself.
every time I try to re-order the menu items?
I have this error too.
And solved by deleting problem menu. It has incorrect nest_left and nest_right properties.
Not sure if the problem lies in the reorder.htm
, it looks to be posting incorrect moveData.targetNode
data, I could be wrong though ;)
I think it's not bug menumanager.
Menumanager uses nested sets, which included to octoberCms.
In my case I have the same error and solved it by deleting incorrect menus in database.
Can you post there dump of your table?
What do you mean "solved by deleting incorrect menus in database"? I get this error if I just create a new menu and try to re-order it. There are no other menus in DB, just the single one.
If I delete it and create another menu, I will get the same error. Here are my steps:
Step 2: Create new menu items:
Step 3: Try to re-order items under "Top Nav" parent, as children & get this error:
Step 4: This is the menu after re-ordering - Blog should be under "Top Nav":
And here is a grab of my DB benfreke_menumanager_menus
table after the above:
Am I doing something wrong?
No, you are right. There is something wrong with it. Trying to find out problem.
I could be wrong, but I think it's an error in the reorder.htm
, as when you try to re-order the items, in the browser console you get:
POST http://localhost:8888/october/backend/benfreke/menumanager/menus/reorder 500 (Internal Server Error)
with the alert of A node cannot be moved to a descendant of itself.
I don't think it's posting the correct moveData.targetNode
You see, record with id 6 and id 7 has the same nest_left
and nest_right
property.
It should be id = 7: nest_left = 5 and nest_right=6
It's not bug with reorder.html. Reorder working fine. It's problem with creating menu.
Try this: delete all menus. Create first menu, then second. And third. After second menu - the rest menus has the same nest_left and nest_rigtht properties.
There should be a method in the nested set behaviour to allow fixing of
this very error.
It's game of thrones night, so I haven't had a chance to look at it yet.
I'm confident it's a bug with the core code, but there should also be a fix
available in it. If not, I know where I can get some code from to fix it.
On 16/06/2014 9:34 pm, "Adis" notifications@github.com wrote:
You see, record with id 6 and id 7 has the same nest_left and nest_right
property.
It should be id = 7: nest_left = 5 and nest_right=6It's not bug with reorder.html. Reorder working fine. It's problem with
creating menu.Try this: delete all menus. Create first menu, then second. And third.
After second menu - the rest menus has the same nest_left and nest_rigtht
properties.—
Reply to this email directly or view it on GitHub
#10 (comment)
.
Hi @DanielHitchen , this issue should be fixed with 1.0.6. At least, I wasn't able to repeat it but I can see how it would have happened.
Can you confirm it's fixed from your end, and close if it is please? If it's not I'll do some more testing and figure out where I'm going wrong.
It's fixed by commenting out NestedSet behavior. I prove it.
@benfreke that all seems to be working great now :)