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

TypeError: k[c[o].parent.toString(...)] is undefined #1575

Closed
tehnotronic opened this issue Nov 15, 2016 · 10 comments
Closed

TypeError: k[c[o].parent.toString(...)] is undefined #1575

tehnotronic opened this issue Nov 15, 2016 · 10 comments
Labels

Comments

@tehnotronic
Copy link

Steps to reproduce

  1. Open teampass as user

Expected behaviour

Folders tree should be displayed

Actual behaviour

Tree keeps loading and no folders show up

Server configuration

Operating system:
Debian
Web server:
Apache
Database:
MySQL
PHP version:
5.6
Teampass version:
2.1.26
Updated from an older Teampass or fresh install:
Fresh

Client configuration

Browser:
Firefox, Edge
Operating system:
Windows

Logs

Web server error log

Insert your webserver log here

No errors in webserver log, all request are 200 OK.

Firebug log (How to?)

Insert the Firebug log here

Firefox console shows error:
TypeError: k[c[o].parent.toString(...)] is undefined

Looks like jquery doesn't know how to parse input from database or something strange is returned.

@tehnotronic
Copy link
Author

@nilsteampassnet
Copy link
Owner

Difficult to help here. I don't see in what file the error is.
This basic feature is always tested. So I'm wondering if you have any special setting for this user?
Are all users impacted?

@tehnotronic
Copy link
Author

So I went deep, upgraded to current development. Only some users are affected. The reason is roles matching to folders. If a role has read or write access to level 3 folder, but not to level 1, the tree is not loaded. For example I have folders:

  1. linux servers
    1.1) production
    1.1.1) file_share
  2. windows

If my role has access to linux or windows, folder tree is loaded. If my role has only access to file_share and not to linux_server, tree is not loaded. If I give access to whole linux servers, everything is ok.
I see this as a bug, because some users should only have access to subfolders and not to first level folders also.

@nilsteampassnet
Copy link
Owner

Strange, I've tried similar context.
Here is the config for user "Jean" in group "Users"
image

Now when Jean is connected, he sees this
image

I have some difficulties to understand this error you get.
Can you also provide the result of the query that loads the tree?

@tehnotronic
Copy link
Author

This is my output of tree.php when it only shows the loading ring and no tree content:
[{"id":"li_2", "parent":"#", "text":"user (<span class='items_count' id='itcount_2'>0</span>|0|0)" , "li_attr":{"class":"jstreeopen", "title":"ID [2] "}, "a_attr":{"id":"fld_2", "class":"folder" , "onclick" :"ListerItems('2', '0', 0)", "ondblclick":"LoadTreeNode('2')"}}, {"id":"li_38", "parent":"#", "text" :"Linux (<span class='items_count' id='itcount_38'>2</span>|2|1)", "li_attr":{"class":"jstreeopen" , "title":"ID [38] "}, "a_attr":{"id":"fld_38", "class":"folder" , "onclick":"ListerItems('38', '0', 0)", "ondblclick":"LoadTreeNode('38')"}}, {"id":"li_50", "parent":"li_38", "text":"Samba servers (<span class='items_count' id='itcount_50'>0</span>|0|0)", "li_attr":{"class":"jstreeopen", "title":"ID [50] "}, "a_attr":{"id":"fld_50", "class":"folder" , "onclick":"ListerItems('50', '0', 0)", "ondblclick" :"LoadTreeNode('50')"}}, {"id":"li_43", "parent":"li_30", "text":"<i class='fa fa-eye'></i>&nbsp;Some Lv3 folder (<span class='items_count' id='itcount_43'>0</span>|0|0)", "li_attr":{"class":"jstreeopen", "title" :"ID [43] Ainult vaatamiseks"}, "a_attr":{"id":"fld_43", "class":"folder_not_droppable" , "onclick":"ListerItems ('43', '1', 0)", "ondblclick":"LoadTreeNode('43')"}}]

@nilsteampassnet
Copy link
Owner

I think the error is somewhere else as this json array is perfectly formed.
So it cannot be the source of the issue you have.

Can you share your screen with me for better debug?

@tehnotronic
Copy link
Author

Ok, it seems like a jstree timing issue reported here: http://stackoverflow.com/questions/38520980/jstree-cannot-read-property-children-of-undefined-timing-issue
Maybe the issue is that tree.php loading takes 10 seconds and I have to speed it up somehow?
http://i.imgur.com/b6KMEtR.png

@nilsteampassnet
Copy link
Owner

Perhaps a direction to investigate.

I will try to put some "pauses" in the script to reproduce this long tree load.

nilsteampassnet pushed a commit that referenced this issue Nov 23, 2016
Fix for #1575, #1580
@nilsteampassnet
Copy link
Owner

I finally could reproduce.
THis issue doesn't appear if option "Hide inaccessible password folders" is set to NO.

With the last commit, it is corrected.
Please test and tell me.

@tehnotronic
Copy link
Author

Confirmed, fixed. Thank you!

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

No branches or pull requests

2 participants