LP#1781235: fix changing primary user barcode in web client user/gmcharlt/lp1781235_set_primary_barcode
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Sep 2018 14:56:43 +0000 (10:56 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Wed, 5 Sep 2018 14:56:43 +0000 (10:56 -0400)
commit4d9351b862ce6c6f32eed599008c484b01c3809b
treede2d6289887860b8f228521b69ed380094bb2d8b
parent11d9725b548c609b4610de55195b40f41e1c42ee
LP#1781235: fix changing primary user barcode in web client

This patch fixes a bug where the patron card dialog would
not allow the user to change the primary barcode under certain
circumstances. The fix is to ensure that the radio buttons
controlling the selection of the primary card are bound to
exactly one scope variable; otherwise, the /last/ barcode in the
list that had a primary value set after user interaction would
be the winner.

To test
-------
[1] Use the 'replace barcode' feature in the patron editor to
    create a test patron with 3 barcodes:

    - barcode A
    - barcode B
    - barcode C (which as last created, would be primary)

[2] Attempt to make barcode A the primary barcode again using
    the 'See All' patron card dialog in the patron editor.
[3] Note that the change of primary barcode doesn't stick
    upon saving the patron record.
[4] Apply the patch and repeat steps 1-3. This time, the
    primary barcode should be changed as expected.
[5] Verify that other patron edit actions and registering a
    new patron record continue to work as expected.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/patron/t_patron_cards_dialog.tt2
Open-ILS/web/js/ui/default/staff/circ/patron/regctl.js