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

Set the leaf property to true instead of 1 #12734

Merged
merged 4 commits into from
Feb 25, 2016
Merged

Set the leaf property to true instead of 1 #12734

merged 4 commits into from
Feb 25, 2016

Conversation

sergant210
Copy link
Collaborator

Problem description

If the leaf property of elements is set to 1, function TreeNode.isLeaf () stops working correctly.

//TreeNode.isLeaf function
isLeaf : function(){
    return this.leaf === true;
}

### Problem description
If the leaf property of elements is set to 1, function TreeNode.isLeaf () stops working correctly. 
```
isLeaf : function(){
    return this.leaf === true;
}
```
@exside
Copy link
Contributor

exside commented Dec 7, 2015

I found many more of these, maybe a folder search in the modx repo will reveal them to you as well =), for example in:

/core/model/modx/processors/security/documentgroup/getnodes.php
/core/model/modx/processors/security/documentgroup/getpairingnodes.php
/core/model/modx/processors/element/getnodes.class.php -> there is more than one as far as I can see!

@Mark-H
Copy link
Collaborator

Mark-H commented Dec 8, 2015

Hi @sergant210 - it doesn't look like there's a CLA for you on file. Could you please head over to modx.com/cla to get that squared away?

We also have a template for pull request descriptions at https://github.com/modxcms/revolution/blob/2.x/CONTRIBUTING.md#template-1 - if you follow those three questions, that gives us a bit more information on how to test your contribution and provides a useful log of things. Could you please elaborate a bit on that, even though this is such a small patch (in terms of line of code, not in effort figuring it out I'm sure!)

@Mark-H Mark-H mentioned this pull request Dec 8, 2015
@sergant210
Copy link
Collaborator Author

What does it do ?

Set the leaf property of elements from the elements tree to true instead of 1. This must be also fixed in the files described by exside above.

Why is it needed ?

Without this fix you can not check tree nodes by the function Node.isLeaf().

Related issue(s)/PR(s)

Not found.

@Mark-H
Copy link
Collaborator

Mark-H commented Jan 13, 2016

Hi @sergant210 - would it be possible for you to update the pull request with the other files noted as well? If you don't have time for that I can get this merged, but it sounds like this is an area where we could get more consistency in general.

@sergant210
Copy link
Collaborator Author

@Mark-H Ok. I'll try.

@sergant210
Copy link
Collaborator Author

@Mark-H Done.

@theboxer theboxer self-assigned this Feb 25, 2016
@theboxer theboxer added this to the v2.5.0-pl milestone Feb 25, 2016
@theboxer theboxer merged commit 9b3f1f6 into modxcms:2.x Feb 25, 2016
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

Successfully merging this pull request may close these issues.

4 participants