
Detailed description of the
Okay so I have been pulling my hair on this one for the entire day and I finally managed to reproduce the exact steps that this bug happens under!
The problem arises in the AD&D 2E Revised character sheet: https://github.com/Roll20/roll20-character-sheets/tree/master/AD%26D%202E%20Revised, but could very well also be a problem in other character sheets!
In the sheet there are two repeating sections:
<fieldset class="repeating_gear"> <input type="text" name="attr_geardesc" </fielde <fieldset class="repeating_gear-stored"> <input type="text" name="attr_gear-stored-desc"> </fieldset>
For each row to the gear-stored section, an invisible ghost row will confuse the index in the gear section.
The nomral 'Add' button can be used. I also tested with a sheet worker with the following code:
let newrowid = generateRowID(); let section = "gear-stored"; let field = "gear-stored-desc"; let newValue = {}; newValue[`repeating_${section}_${newrowid}_${field}`] = "test"; setAttrs(newValue);
Minimum steps to reproduce the problem
Steps to reproduce
- Have two repeating sections. In this case gear and gear-stored
- Use a sheet worker or the 'Add' button to create a new row in section gear-stored
- See that a row is created in the gear-stored section.
- Try to read the first value of the gear section using the chat command: @{selected|repeating_gear_$0_geardesc}
Expected
Actual
Note: If you delete the row in the gear-stored section then the invisible "ghost row" will also disappear from the gear section.
I have setup a test game with a button that runs the above code and inserts the ghost rows: https://app.roll20.net/join/9451746/0amewg
I have made a button, that is hooked up to the above mention sheet worker code for insert rows into the gear-stored section, for easier and faster testing.
The same bug has also been tested with two other sections named weapons and weapons-damage, where the same behavior has been spotted. For each row in the weapons-damage section, an invisible "ghost row" will confuse the index of the weapons section.
Description of setup
Tested with the following browsers |
| ||||||||
Operating system |
|
Personally I think the problem is that the dash in the section name gets confused with the dash in the row id, and that is the culpit for the problem. I have however not been able to find any documentation saying that dashes are not allowed in repeating section names.