1) create a patient with 2 or more genes
2) manually delete gene #2
3a) without closing the edit tab, in a separate tab in view mode observe that gene #1 was deleted instead of gene #2
3b) in the original "edit" tab click 'save and view summary". Both genes will be present
The reason is that the code in geneVariantmacros.vm calls
which always gets the first object because (to be investigated if this is correct) request.objnumber always evaluates to a string, which gets evaluated to 0. The fix is to wrap request.objnumber with $mathtool.toInteger() as is done in some other places in the code.
(it is to be investigated why it ever worked at all. Currently it works with no bugs on (old) playground.phenpotips.org, but is buggy on production PC)
A test page can be created to see what works and what not: