This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

maxDubovsky
maxDubovsky

Hi Folks,

I'm trying to create a tree based category tree for my project, as an example I would like to have drag and drop tree ordering system same as RainLab.Forum or Ben Freke.Menu. I almost made everything work exapt I'm always getting an errors while moving tree node item: "A node cannot be moved to a descendant of itself." on line 923 of C:\wamp\www\mxlaravel\octobercms\vendor\october\rain\src\Database\Traits\NestedTree.php

There is another issue, when I'm trying to seed_category_table like this:

    // This is a root node
    $mainMenu = Category::create(
        [
            'title'       => 'Main Menu',
            'description' => 'The main menu items',
            'slug'         => 'main-menu'
        ]
    );

    // The top, or primary level of navigation
    $homePage = $mainMenu->children()->create(
        [
            'title' => 'Home Page',
            'description' => 'The primary navigation level',
            'slug' => 'home'
        ]

I 'm getting error: [BadMethodCallException] Call to undefined method October\Rain\Database\QueryBuilder::children()

Please help.

maxDubovsky
maxDubovsky

Solved. The model was not correctly described.

1-2 of 2

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.