Giter VIP home page Giter VIP logo

Comments (8)

lazychaser avatar lazychaser commented on June 18, 2024

What is working unexpected wihtout these modifications?

When I was writing this post, I realized how I can soft delete descendants, more precisely how to restore them if parent is restored.

from laravel-nestedset.

lazychaser avatar lazychaser commented on June 18, 2024

Please, update to 2.4.1, remove your modifications and test

from laravel-nestedset.

asokol1981 avatar asokol1981 commented on June 18, 2024

I update and test.
The problem is that the values of _lft and _rgt are not updated after restore. They contain values before delete.
Table has 2 categories with _lft and _rgt values: 1-2, 3-4. First node is soft deleted. After that table will contain: 1-2, 1-2. And after restore it must be: 1-2, 3-4 (order doesn't matter), but has: 1-2, 1-2.

from laravel-nestedset.

lazychaser avatar lazychaser commented on June 18, 2024

Lft and rgt shouldnt be changed when soft deleted at all
29 íÁÒ 2015 Ç. 20:27 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:

I update and test.
The problem is that the values of _lft and _rgt are not updated after
restore. They contain values before delete.
Table has 2 categories with _lft and _rgt values: 1-2, 3-4. First node is
soft deleted. After that table will contain: 1-2, 1-2. And after restore it
must be: 1-2, 3-4 (order doesn't matter), but has: 1-2, 1-2.

Reply to this email directly or view it on GitHub
#43 (comment)
.

from laravel-nestedset.

asokol1981 avatar asokol1981 commented on June 18, 2024

Ok.

from laravel-nestedset.

lazychaser avatar lazychaser commented on June 18, 2024

Ok what? Is this what happens or not?
29 íÁÒ 2015 Ç. 20:47 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:

Closed #43 #43.

Reply to this email directly or view it on GitHub
#43 (comment)
.

from laravel-nestedset.

asokol1981 avatar asokol1981 commented on June 18, 2024

SoftDeletes now should work. But I think not to change _lft and _rgt is not right. It will brake result of Node::getDescendantCount and may be will brake another expectations. :)

from laravel-nestedset.

lazychaser avatar lazychaser commented on June 18, 2024

Well, yeah, but you shouldnt strongly rely on this values. Anyways, i would
wipe soft deleted models from db from time to time.
29 íÁÒ 2015 Ç. 21:05 ÐÏÌØÚÏ×ÁÔÅÌØ "asokol1981" [email protected]
ÎÁÐÉÓÁÌ:

SoftDeletes now should work. But I think not to change _lft and _rgt is
not right. It will brake result of Node::getDescendantCount and may be
will brake another expectations. :)

Reply to this email directly or view it on GitHub
#43 (comment)
.

from laravel-nestedset.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.