Roll20 uses cookies to improve your experience on our site. Cookies enable you to enjoy certain features, social sharing functionality, and tailor message and display ads to your interests on our site and others. They also help us understand how our site is being used. By continuing to use our site, you consent to our use of cookies. Update your cookie preferences .
×
Create a free account

[Bug] getSectionIDs returns more IDs than rows visible

1466063190

Edited 1466070344
From what I thought even if there are partial rows because Sheet Workers or API screwed something up there should always be as many IDs per repeating section as rows and those partial rows would show up red bordered. However, I have a character where getSectionIDs clearly returns more IDs than there are rows: getSectionIDs("repeating_"+name, function(idarray) { console.log("Update ID for "+"repeating_"+name); for(var i=0; i < idarray.length; i++) { var attrs ={}; attrs['repeating_'+name+'_' + idarray[i] + '_'+name+'_id'] = idarray[i]; console.log('repeating_'+name+'_' + idarray[i] + '_'+name+'_id'+"="+idarray[i]) //setAttrs(attrs,{silent:true}); } }); There are 6 IDs but only 5 rows Update ID for repeating_skillsknowledge VM41:1346 repeating_skillsknowledge_-kkefuj8tmv0erzg328i_skillsknowledge_id=-kkefuj8tmv0erzg328i VM41:1346 repeating_skillsknowledge_-kkefujhgzasv6cmld0q_skillsknowledge_id=-kkefujhgzasv6cmld0q VM41:1346 repeating_skillsknowledge_-kkefuneqskn4l2w9rtv_skillsknowledge_id=-kkefuneqskn4l2w9rtv VM41:1346 repeating_skillsknowledge_-kkkhwn68r6sxsskqp49_skillsknowledge_id=-kkkhwn68r6sxsskqp49 VM41:1346 repeating_skillsknowledge_-kkn2ik28vgwmdhzfuaz_skillsknowledge_id=-kkn2ik28vgwmdhzfuaz VM41:1346 repeating_skillsknowledge_-kkn8fmzckzn3runhnz0_skillsknowledge_id=-kkn8fmzckzn3runhnz0 Once I do enable the setAttrs call I obviously get a red bordered bugged row because this row does not really exist but has attributes. When I do list all the attributes from the API I get only 4 rows and IDs - which is correct: {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_name","current":"Hobbywissen","max":"","_id":"-KKEfuJ7fEQ-8hhejEkn","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_attribut","current":"@{int}","max":"","_id":"-KKEfuJ809JiZBSQuRFM","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_limit_text","current":"{{limit=4}}","max":"","_id":"-KKEfuJ809JiZBSQuRFN","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_limit_formatted","current":"kh4","max":"","_id":"-KKEfuJ9HliA_HzjxLwf","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_limit_display","current":4,"max":"","_id":"-KKEfuJAJzvfO9RX_NzP","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_limit_total","current":4,"max":"","_id":"-KKEfuJBRhkUiRI_iupt","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_desc","current":"{{unused}}","max":"","_id":"-KKEfuJCo7Zf-vuW9BVy","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_id","current":"-kkefuj8tmv0erzg328i","max":"","_id":"-KKEfuJDatkQ0yZuAdO_","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_basis","current":"3","max":"","_id":"-KKEfuJDatkQ0yZuAdOa","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_mod","current":"0","max":"","_id":"-KKEfuJEd1sMqs2QRIuw","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_show_details","current":"0","max":"","_id":"-KKEfuJFmdv7aSaArfl7","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJ8TMv0erZg328i_skillsknowledge_limit","current":"@{glimit}","max":"","_id":"-KKEfuJGA4tOKJr8rPSI","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_name","current":"Straßenwissen","max":"","_id":"-KKEfuJGA4tOKJr8rPSJ","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_limit_text","current":"{{limit=4}}","max":"","_id":"-KKEfuJHWo26A26zSiyR","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_limit_formatted","current":"kh4","max":"","_id":"-KKEfuJIX8WYoyRpIkCs","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_limit_display","current":4,"max":"","_id":"-KKEfuJJy4MtCE72mN4_","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_limit_total","current":4,"max":"","_id":"-KKEfuJJy4MtCE72mN4a","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_desc","current":"{{unused}}","max":"","_id":"-KKEfuJKFFN_nsnrovYF","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_id","current":"-kkefujhgzasv6cmld0q","max":"","_id":"-KKEfuJLkZcjVlHupBgw","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_attribut","current":"@{int}","max":"","_id":"-KKEfuJM50_-zYxTZ9c6","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_basis","current":"3","max":"","_id":"-KKEfuJNILzmsVz-WhK9","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_show_details","current":"0","max":"","_id":"-KKEfuJO0r0RnrhTN1nK","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_limit","current":"@{glimit}","max":"","_id":"-KKEfuJP1GnvmANOKU--","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuJHgZAsv6CMLd0q_skillsknowledge_mod","current":0,"max":"","_id":"-KKKcZuZJQW1FzElWkCM","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_name","current":"Akademisches Wissen","max":"","_id":"-KKEfuNDPFPkq_gB-d9-","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_id","current":"-kkefuneqskn4l2w9rtv","max":"","_id":"-KKEfuNEeMDOKFkWo1tN","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_basis","current":"3","max":"","_id":"-KKEfuNEeMDOKFkWo1tO","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_limit_text","current":"{{unused}}","max":"","_id":"-KKFfxUzB_sgDLeTlE7b","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_limit_formatted","current":"kh9999","max":"","_id":"-KKFfxV5TUCKxx2ou8nU","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_limit_display","current":"-","max":"","_id":"-KKFfxVCCjDFygKBrVNC","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_limit_total","current":"-","max":"","_id":"-KKFfxVHk3nvJd9fiUqh","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_desc","current":"{{unused}}","max":"","_id":"-KKFfxVNp1MlJSjMMHcO","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_mod","current":0,"max":"","_id":"-KKKcZueQTehAfSvW_d1","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKEfuNEqskn4L2W9RTv_skillsknowledge_show_details","current":"0","max":"","_id":"-KKKe6tSGguIml4yEE5y","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKKhWN68r6SXSSkqP49_skillsknowledge_name","current":"Berufswissend","max":"","_id":"-KKKhYe4QOklkKN2EQ0H","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKKhWN68r6SXSSkqP49_skillsknowledge_id","current":"-kkkhwn68r6sxsskqp49","max":"","_id":"-KKKhYiUp3uubAcZULZq","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKKhWN68r6SXSSkqP49_skillsknowledge_basis","current":"3","max":"","_id":"-KKKhYxZ00I74S5dWMF3","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} {"name":"repeating_skillsknowledge_-KKKhWN68r6SXSSkqP49_skillsknowledge_show_details","current":"0","max":"","_id":"-KKKhgnA_GLASNDe0R4n","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"} But when I use log("Bugged:"); var attrs = findObjs({type:'attribute'}); var bugged = _.filter(attrs,function(o){return o.get('name').toLowerCase().indexOf("-kknebfz6-uor3wropzd") != -1}); log(bugged); log("Done"); I do get: [{"name":"repeating_skillsknowledgemod_-KKNEBFZ6-Uor3wropZD_skillsknowledge_skillname","current":"j","max":"","_id":"-KKNEBO3wVME6CVH2N0U","_type":"attribute","_characterid":"-KKEftqYdF4FjZcabCQ_"}] Which is how a second not nested section had been named. However this ID should not show up on the above getSectionID. Wild and random guess: getSectionID uses a faulty regex which matches other similarly named repeating sections as well and therefore using getSectionIDs for section A returns IDs of both sections and setAttr will create a new attribute for each ID in section B as well. Edit: DAMN... editing and debugging i managed it to post wrong IDs here. The explanation here is still what happened. I had 2 similar named repeating sections and for each ID in section B the getSectionID returned one additional ID. However it is not reproduceable with above code anymore and I have manually removed the faulty attribute from the API and changed the name of the second repeating section to not match the first anymore.
1466090867
chris b.
Pro
Sheet Author
API Scripter
Was the same ID in both lists? I did that once via code, and it bugs out the entire sheet. It really hates having the ID appear in more than one row. Which is kind of odd since the old IDs are still just flat numbers 1,2,3, etc.
1466092360

Edited 1466093665
The ID was an rowID from list B but it appeared in getSection for list A. I am pretty sure the only reason both repeating rows behaved oddly was because one was named repeating_A and the other repeating_Amod. Therefore names for B would match A but not vice versa. It should be easy to test that and I will test it when I have time. It really looked like getSectionID returned a match on the Amod as well like it was looking for a match for "repeating_A" and didn't care for the superflous "mod" suffix.
1466200404
Phil B.
Forum Champion
Sheet Author
Good catch there, Wandler. You were close with your guess too. When it's building the list of attributes it's checking each name with an .indexOf of the given search. So, the search "repeating_a" returns true for both repeating_a and repeating_amod. I don't have time to properly fix and test this before the weekend, but I will try to get it fixed some time early next week. I'm actually surprised it's made it this long without causing anyone any issues.
Cool :)