We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Incubator tree move a node not work

Root, lft=1, rgt=8

1.1, lft=2, rgt=3

1.2, lft=4, rgt=5

1.3, lft=6, rgt=7

I called.

$root = Categories::findFirst(1);

$x13 = Categories::findFirst(13);

$x13->moveAsFirst($root);

It return There is no active transaction But database change

Root, lft=1, rgt=8

1.3, lft=2, rgt=3

1.1, lft=4, rgt=5

1.2, lft=6, rgt=7

How can fixed this code :(



43.9k

Hi,

in source code, function moveNode handle db connection.



2.8k
Accepted
answer

$di->set('db', function () use ($config) { ........... }, true);

Sorry my mistake. This di db must shared