A
A
Alexander2019-08-27 14:54:49
MySQL
Alexander, 2019-08-27 14:54:49

How to remove a node from nested sets, and put child elements under its parent?

There was a task in nested sets in Joomla to delete nodes, but at the same time leave "children" so that they become under the "parent" of the node being deleted. The standard delete method deletes both a node and its children.
In Joomla, the table structure is defined by the fields:

id (primary key)
parent_id
lft
rgt
level

More precisely, I understand that I can simply change the parent_id of the child nodes to a new one. But the left and right values ​​will remain the same. They don't need to be counted or do they?
Maybe someone has experience, I do not want to reinvent the wheel.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Anton, 2019-08-27
@Fragster

Can't be counted

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question