Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove self from selection #9

Open
angelinek opened this issue Jan 15, 2021 · 5 comments
Open

Remove self from selection #9

angelinek opened this issue Jan 15, 2021 · 5 comments

Comments

@angelinek
Copy link

Hi,

after I create a node, when I want to edit on it, the selection will include the node that I am editing.

Eg. I create category A, and attach category B,C,D as its sub category, after creation, when I want to make some changes on the sub category of A, A will appear in the selection also, is there any way I can remove A from selection?

Thanks alot for your fast response!

@phoenix-lib
Copy link
Owner

Hi, even if you select parent category, it will not any affect on save result, because there is a validation rule in the backend that excludes this situation.

I think about it, it's probably better to disable such categories on frontend. But I need more time to think and test some concepts.

@angelinek
Copy link
Author

Wonder do you use relatableQuery () function for this?
Can I do filter to remove self from selection?

@angelinek
Copy link
Author

If not able to remove, is there any way to at least disable it, so that user will not be able to choose that category?

@phoenix-lib
Copy link
Owner

Hi, I have a draft for solving this problem, but I need more time to done it.

To disable self in list, I need to change the tree generation and this is the next point in package road map :)

@eboye
Copy link

eboye commented Nov 6, 2021

I've tried adding ->rule('different:id') but it doesn't work. As I just had a massive CPU/RAM spike on production server as I thought it can't be saved with such value :)

I'm going to implement the Observer where it nulls the value on save/update to prevent such things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants