• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

kobotoolbox / kpi / 22857255360
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: beccagraber/dev-714-add-hints
DEFAULT BRANCH: master
Ran 09 Mar 2026 02:39PM UTC
Jobs 2
Files 896
Run time 3min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Mar 2026 02:04PM UTC coverage: 82.12% (+0.006%) from 82.114%
22857255360

push

github

web-flow
fix(formBuilder): ensure cloned choices and rows ids are unique DEV-1759 (#6740)

### 📣 Summary

When cloning a question in Form Builder the result is now ensured to be
a copy with unique ids. Previously clone was using original row ids
leading to unexpected behaviour.

### 💭 Notes

The problem was happening for every cloned row. The `$kuid` was being
cloned too. Luckily we don't rely on `$kuid` much, but it is an obvious
error that could be potentially problematic.

The visible issue was happening for cloning of few types: `select_one`,
`select_multiple`, `rank` or `score`. When cloning such row, code was
also cloning the list of choices for it. Before the fix the cloned list
of choices was wrongly being synced between two rows (the original and
the clone). This leads to confusing issues as the syncing isn't obvious
and might get unnoticed and lead to unwanted changes in the form.

Changes in this PR:
- In `clone` function of choices list
(`jsapp/xlform/src/model.choices.coffee`), I ensure that the unique ids
are stripped and regenerated - for the list itself and for each option.
I also register the new list in global list of `choices`
- In `clone` (look for `rr.clone`) function of `ScoreRankMixin`
(`jsapp/xlform/src/model.row.coffee`) I similarly ensure unique ids are
stripped and regenerated - for the row itself and for the score/rank
levels
- In `clone` function of `row.Row` (`jsapp/xlform/src/model.row.coffee`)
I introduced safety measure to ensure unique properties are not being
copied and `select_one` and `select_multiple` are properly copying only
non-unique things
- Added one `TODO` comment for a weird single use `_isCloned` flag
- Added comment about us purposefuly not allowing `kobomatrix` cloning
(as I thought initially it was a mistake/bug)
- Some minor code readability improvements (coffee syntax is not nice)
- Added some comments here and there :) 

### 👀 Preview steps

I recommend this setup:
- Create new empty form and save (unselect ... (continued)

7536 of 11616 branches covered (64.88%)

28926 of 35224 relevant lines covered (82.12%)

1.62 hits per line

Jobs
ID Job ID Ran Files Coverage
1 22857255360.1 09 Mar 2026 02:39PM UTC 894
79.81
2 22857255360.2 09 Mar 2026 02:45PM UTC 896
82.08
Source Files on build 22857255360
  • Tree
  • List 896
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • d295b27c on github
  • Prev Build on main (#22778670892)
  • Next Build on main (#22861727720)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc