dimagi/Vellum — pull request #69 by mwhite (2013-06-19 19:50:04+00:00)
Title: Select item auto itextid

This fixes Case:60215 (multiple select items end up with the same itext
id after copying a question, renaming it, and then copying the original
again) and probably fixes Case:63418 (floating involving using
copy) (given that the only time I have ever reproduced it was when I was
working on this).

Select Item Itext IDs generally look like this:

--label

Previously,

- when you created a select item, its itext id would get autogenerated
from the select's id
- when you changed a select item's value, its itext id would get updated
as long as the existing itext id was autogenerated
- when you changed a select's id, nothing would happen to the select
item's itext id

This last fact became more of a problem with the advent of question
copy, because question copy decides what IDs are available without
considering the autogeneration of itext ids and potential for conflict
there, so if you copy a question, **rename it**, but don't change the itext
ids, then you could copy the same question and end up with overlapping
itext ids.

This change extends the select item itext id autogeneration to always
occur whenever you change the select item ID. (However, if the old
select item itext id was changed by the user, then it's kept.)