Balance owed visually not updated and multiple definitions of function display() in ParticipantFeeSelection form
This came out of PR review for https://github.com/civicrm/civicrm-core/pull/18238
There's probably multiple ways of getting here and different configurations might have different outcomes but take a stock demo install and do
- Find participants.
- Pick one and click View, e.g. for the rainforest event.
- Click the blue Change Selections link.
- Change the selected price.
- Nothing happens. No errors in console. At the very least I'd expect the balance owed field to visually update. Saving seems to change the selection as expected.
If you view-source, you can see the display() javascript function is defined 3 times apparently in global space each time. Doing some js debugging the one that gets run is the one from CRM/Price/Form/Calculate.tpl, which itself seems to be included twice so two of the display() functions are identical since they're both from there.
I can't see where the first function is used in civi - the one from CRM/Event/Form/ParticipantFeeSelection.tpl - but there might be many configurations that lead here and do different things.