Bug 18246: Patron card creator: Unit not always displays properly in layouts

To reproduce:

1) Create a new layout
2) Select an unit in "Units selection"
3) Save
4) Edit layout again
5) Select other unit, e.g. 'SI Centimeter'
6) Save
7) Repeat
8) Edit again
Error: Latest unit seems to stick and can no longer be changed, because
in units drop down, multiple untis are marked as selected.

To test:
1) Apply patch
2) Repeat steps above, verify that value for units always display as expected.

Signed-off-by: Jesse Maseto <jesse@bywatersolutions.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
This commit is contained in:
Marc Véron 2017-03-11 19:17:37 +01:00 committed by Brendan A Gallagher
parent 20ad341eef
commit 37da40b323
1 changed files with 2 additions and 0 deletions

View File

@ -146,6 +146,8 @@ if ($op eq 'edit') {
foreach my $unit (@$units){
if ($unit->{'type'} eq $layout->get_attr('units')) {
$unit->{'selected'} = 1;
} else {
$unit->{'selected'} = 0;
}
}