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] "Ghost rows" in repeating sections when a dash '-' is used in the section name

December 29 (4 years ago)

Edited March 01 (4 years ago)
Peter B.
Plus
Sheet Author

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

  1. Have two repeating sections. In this case gear and gear-stored
  2. Use a sheet worker or the 'Add' button to create a new row in section gear-stored
  3. See that a row is created in the gear-stored section.
  4. Try to read the first value of the gear section using the chat command: @{selected|repeating_gear_$0_geardesc}

Expected

  • Get an error that field does not exist, similar to this:

Actual

  • Get an empty string as a value and print it in the chat:

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
  • Google Chrome v. 83.0.4103.61 (Official Build) (64-bit)
  •     No Addons/Extensions (Clean install)
  • Firefox v. 84.0.1 (64-bit)
  •     No Addons/Extensions (Clean install)
  • Microsoft Edge v. 87.0.664.66 (Official build) (64-bit)
  •     No Addons/Extensions (Clean install)
Operating system

EditionWindows 10 Pro
Version

20H2

OS Build19042.685
ExperienceWindows Feature Experience Pack 120.2212.551.0


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.

January 02 (4 years ago)
Peter B.
Plus
Sheet Author

I made another minimal test game to ensure nothing in my own sheet was creating problems. I can still reproduce the bug in a sheet only containing the following code:

<div class="sheet-2colrow">
    <div class="sheet-col">
        repeating_row
        <fieldset class="repeating_row">
            <input type="text" name="attr_name" title="repeating_row_$X_name"/>
        </fieldset>
    </div>
    <div class="sheet-col">
        repeating_row-dash
        <fieldset class="repeating_row-dash">
            <input type="text" name="attr_name" title="repeating_row-dash_$X_name" />
        </fieldset>
    </div>
</div>

I made another test game with the bug visible here:

Ghost rows minimal example

January 07 (4 years ago)
Peter B.
Plus
Sheet Author

Update:

Roll20 has use the information in this post to created bug ticket for their internal Development team.

Hopefully it will be fixed some day in the future.

January 18 (4 years ago)
Peter B.
Plus
Sheet Author

Found another example that introduces Ghost rows. Repeating section using numbers can also introduce it!

The following code has replicated the problem:

<div class="sheet-2colrow">
    <div class="sheet-col">
        repeating_row
        <fieldset class="repeating_row">
            <input type="text" name="attr_name" title="repeating_row_$X_name"/>
        </fieldset>
    </div>
    <div class="sheet-col">
        repeating_row2
        <fieldset class="repeating_row2">
            <input type="text" name="attr_name" title="repeating_row2_$X_name" />
        </fieldset>
    </div>
</div>
January 18 (4 years ago)

Edited January 18 (4 years ago)
Peter B.
Plus
Sheet Author

Workaround for "ghost rows" messing with indexes:

Step 1 - Find the rows that cause trouble:

Use the following code to find all the rows that have problems:

Should be index0: @{selected|repeating_weapons_$0_weaponname} 
Should be index1: @{selected|repeating_weapons_$1_weaponname}
Should be index2: @{selected|repeating_weapons_$2_weaponname}
...

Any row that comes back with an empty name is affected by a ghost row. See this images for an example output:


Step 2 - Fix the order

In order to "fix" the order of rows for a repeating sections, click 'Modifiy' and moving the lowest rows to the top. Do that for all rows affected:

Step 3 - Validate the indexes:

Use the same code as before to validate the new indexes are correct:

Should be index0: @{selected|repeating_weapons_$0_weaponname} 
Should be index1: @{selected|repeating_weapons_$1_weaponname}
Should be index2: @{selected|repeating_weapons_$2_weaponname}
...

I hope this helps anyone who experiences the problem with rows :)

January 19 (4 years ago)
vÍnce
Pro
Sheet Author

Hi Peter,

have you also reported this to the helpdesk

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

January 19 (4 years ago)
Peter B.
Plus
Sheet Author

∇ince said:

Hi Peter,

have you also reported this to the helpdesk

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

Hey Vince, thank you for your interest.

Yes, I have added it to the helpdesk and they have replied:

Peter B. said:

Update:

Roll20 has use the information in this post to created bug ticket for their internal Development team.

Since they created the bug ticket, I haven't heard anymore from the help desk. So I guess it will be fixed "soon™" ¯\_(ツ)_/¯




January 19 (4 years ago)
vÍnce
Pro
Sheet Author

soon™... ;-)

January 19 (4 years ago)
Andreas J.
Forum Champion
Sheet Author
Translator

∇ince said:

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

Well, the sticky thread tells us to submit a support ticket, and says nothing about making posts here. They really should change the name of the place and communicating this more clearly.

January 19 (4 years ago)
vÍnce
Pro
Sheet Author


ᐰndreas J. said:

∇ince said:

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

Well, the sticky thread tells us to submit a support ticket, and says nothing about making posts here. They really should change the name of the place and communicating this more clearly.

Agreed.


January 20 (4 years ago)
Peter B.
Plus
Sheet Author

∇ince said:

ᐰndreas J. said:

∇ince said:

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

Well, the sticky thread tells us to submit a support ticket, and says nothing about making posts here. They really should change the name of the place and communicating this more clearly.

Agreed.

Agreed!

∇ince said:

Hi Peter,

have you also reported this to the helpdesk

Seems that the roll20 has stopped reading the Bug Reports & Technical Issues forum... ;-(

I sent the new information about numbers also creating "ghost rows", ie. repeating_row and repeating_row2 and help desk returned with the following email:

Hi there,

Thanks for providing this information. I'm adding it to the ticket I created previously. If there's anything else I can do for you please don't hesitate to let me know.
With this I hope that the fix will be either more extensive/complete and maybe even "sooner™"!