Steps to replicate the issue (include links if applicable):
Consider the following wikitext:
<ref name=myname>Plain with name</ref> <ref name=myname group=groupname>In group with same name</ref>
- Edit in VE
- Edit the 2nd ref, remove the group name and apply changes
What happens?:
- No visible change in the article view of VE
- Errors in the console
Uncaught TypeError: group.firstNodes[index2] is undefined
sortGroupIndexes ve.dm.InternalList.js:422
sortGroupIndexes ve.dm.InternalList.js:413
onTransact ve.dm.InternalList.js:364
emit oojs.js:858
commit ve.dm.Document.js:391
ve.dm.InternalList.js:422:55
sortGroupIndexes ve.dm.InternalList.js:422
sortGroupIndexes ve.dm.InternalList.js:413
onTransact ve.dm.InternalList.js:364
emit oojs.js:858
commit ve.dm.Document.js:391
changeInternal ve.dm.Surface.js:970
change ve.dm.Surface.js:939
updateInternalItem ve.dm.MWReferenceModel.js:159
getActionProcess ve.ui.MWReferenceDialog.js:193
proceed oojs-ui-windows.js:756
execute oojs-ui-windows.js:792
executeAction oojs-ui-windows.js:2930
executeAction oojs-ui-windows.js:3477
onActionClick oojs-ui-windows.js:2744
emit oojs.js:858
emit oojs.js:858
onClick oojs-ui-core.js:2377
jQuery 9
setButtonElement oojs-ui-core.js:2317
OoUiMixinButtonElement oojs-ui-core.js:2260
OoUiButtonWidget oojs-ui-core.js:3970
OoUiActionWidget oojs-ui-windows.js:43
getActionWidget oojs-ui-windows.js:2874
getActionWidgets oojs-ui-windows.js:2860
getSetupProcess oojs-ui-windows.js:2815
proceed oojs-ui-windows.js:756
jQuery 8
execute oojs-ui-windows.js:794
setup oojs-ui-windows.js:2516
openWindow oojs-ui-windows.js:1426
(Async: setTimeout handler)
openWindow oojs-ui-windows.js:1424
jQuery 2
openWindow oojs-ui-windows.js:1411
open ve.ui.WindowAction.js:118
jQuery 8
open ve.ui.WindowAction.js:117
jQuery 3
open ve.ui.WindowAction.js:116
jQuery 8
open ve.ui.WindowAction.js:113
executeWithSource ve.ui.Surface.js:735
execute ve.ui.Command.js:43
onEditButtonClick ve.ui.LinearContextItem.js:121
emit oojs.js:858
onClick oojs-ui-core.js:2377
jQuery 9
setButtonElement oojs-ui-core.js:2317
OoUiMixinButtonElement oojs-ui-core.js:2260
OoUiButtonWidget oojs-ui-core.js:3970
VeUiLinearContextItem ve.ui.LinearContextItem.js:50
VeUiMWReferenceContextItem ve.ui.MWReferenceContextItem.js:21
VeUiCitoidReferenceContextItem ve.ui.CitoidReferenceContextItem.js:3
create oojs.js:1683
setupMenuItems ve.ui.Context.js:176
toggleMenu ve.ui.Context.js:150