Bug 37254: Fix clearing of dropdown values on circulation rules

When one tries to clear the rule they are editing in circulation
rules page via "Clear" button, dropdown selectors aren't populated
with default value (first on the list).

To reproduce:
1. Select a rule to edit.
2. Press "Clear" button to return edit rows values back to default values.
=> Values in dropdowns aren't set back as default, instead they have
same values as rule you edited before pressing "Clear".
3. Apply this patch.
4. Select rule to edit, then press "Clear".
=> Dropdowns now have default values.

Sponsored-by: Koha-Suomi Oy
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz>
Signed-off-by: Laura_Escamilla <laura.escamilla@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit f1f08f92c5)
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Emmi Takkinen 2024-07-04 15:04:42 +03:00 committed by Lucas Gass
parent ab51747dcc
commit d0cb0ff57b
1 changed files with 1 additions and 0 deletions

View File

@ -1464,6 +1464,7 @@
}
});
$(edit_row).find("select").prop('disabled', false);
$(edit_row).find("select option:selected").removeAttr('selected');
$(edit_row).find("select option:first-child").attr("selected", "selected");
$(edit_row).find("td:last input[name='clear']").remove();
}