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

kobotoolbox / kpi / 22857255360 / 2
82%
master: 76%

Build:
Build:
LAST BUILD BRANCH: main
DEFAULT BRANCH: master
Ran 09 Mar 2026 02:45PM UTC
Files 896
Run time 33s
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.08% (+2.3%) from 79.811%
22857255360.2

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)

7585 of 11686 branches covered (64.91%)

28912 of 35224 relevant lines covered (82.08%)

0.82 hits per line

Source Files on job 22857255360.2
  • Tree
  • List 896
  • Changed 34
  • Source Changed 0
  • Coverage Changed 34
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 22857255360
  • d295b27c on github
  • Prev Job for on main (#22778670892.1)
  • Next Job for on main (#22861727720.1)
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