Bug 23218: Fix shift in patron's attributes in batch patron modification

When the "new" button is clicked without selecting a patron's attribute, the update will have unexpected behaviors.

There is indeed a difference in the number of patron's attributes and the number of values.

Test plan:
Go to the batch patron modification
Enter a cardnumber
At the bottom of the page, click "new" without selecting an attribute
On the second line select one, and a value (different than an empty
string)
Save
=> The attribute will be updated with an empty string

Signed-off-by: Maryse Simard <maryse.simard@inlibro.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-06-29 10:18:29 -05:00 committed by Martin Renvoize
parent 84855d75c1
commit ea0127b7fa
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 2 deletions

View File

@ -268,7 +268,7 @@
</select>
</label>
<input type="checkbox" title="check to delete this field" name="disable_input" value="attr0_value" />
<span class="patron_attributes_value"></span>
<span class="patron_attributes_value"><input type"hidden" name="patron_attributes_value" value="poeut"/></span>
<a href="#" class="add_attributes" title="Add an attribute"><i class="fa fa-fw fa-plus"></i> New</a>
<span class="information_category hint" style="width:25%;float:right;"></span>
</li>
@ -396,7 +396,7 @@
span.html('<input type="text" name="patron_attributes_value"/>');
$(disable_input_node).show();
} else {
span.html('');
span.html('<input type="hidden" name="patron_attributes_value" />');
$(disable_input_node).hide();
}
}