-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
[2.x] Fix functionality in the section "Categories" of the elements tree #16488
Conversation
@halftrainedharry - Funny we worked up something for this at the same time! I did so for 3.x though. Perhaps we can review each other's solutions? I'll review yours in the next day or two... |
@halftrainedharry - I assume, since you closed this PR, you want me to apply the changes I made for my 3.x PR to a new 2.x PR. Let me know if that's the case or if you're working on it; just don't want to duplicate efforts ;-) |
Yes, that's correct. |
### What does it do? Adds a new tree method to properly extract Element data from the working tree Node. There are three patterns for a Node's id, but only one was being accounted for in the code. Additionally, cleans up code formatting in the affected methods. ### Why is it needed? Within the Categories tree, these actions are currently inoperable: - Element removal - Plugin activation/deactivation ### How to test 1. Create a handful of Elements (at least one of each type), both within a Category and within the root (no Category) 2. Verify the ability to remove each Element (from both the Categories tree and from within the individual Element trees) 3. Verify the ability to activate/deactivate Plugins (from both the Categories tree and from within the individual Element trees) ### Related issue(s)/PR(s) Resolves #16487 for MODX 3.x Related to 2.x solution #16488 --------- Co-authored-by: Jason Coward <jason@opengeek.com>
### What does it do? Adds a new tree method to properly extract Element data from the working tree Node. There are three patterns for a Node's id, but only one was being accounted for in the code. Additionally, cleans up code formatting in the affected methods. ### Why is it needed? Within the Categories tree, these actions are currently inoperable: - Element removal - Plugin activation/deactivation ### How to test 1. Create a handful of Elements (at least one of each type), both within a Category and within the root (no Category) 2. Verify the ability to remove each Element (from both the Categories tree and from within the individual Element trees) 3. Verify the ability to activate/deactivate Plugins (from both the Categories tree and from within the individual Element trees) ### Related issue(s)/PR(s) Resolves #16487 for MODX 3.0.x Related to 2.x solution #16488 Port of 3.x solution #16489 --------- Co-authored-by: Jim Graham <jim@pixelsandstrings.com>
What does it do?
In some handler-functions, the information about the clicked item (type and id) gets extracted from the node-ID in the tree.
In most sections, the IDs have the prefix
n_
.In the "Categories" section, nodes for other types have the prefix
n_c_
instead:revolution/core/model/modx/processors/element/getnodes.class.php
Line 480 in 3f887dc
This is now taken into account.
Why is it needed?
Some context menu items don't work correctly, when executed for element types (other than "Category") in the "Categories" section of the elements tree.
How to test
Go to the section "Categories" in the elements tree and check that the following options (in the context menu) now work:
<type>
(for the types "Template", "TV", "Chunk", "Snippet" and "Plugin")<type>
here (for the types "Template", "TV", "Chunk", "Snippet" and "Plugin")Related issue(s)/PR(s)
Resolves #16487 for MODX 2.x