Fine level and loan duration aren't displayed when editing items

Bug #1741072 reported by Jason Boyer
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

Eg 3.X

In the web client item editor the loan duration and fine level fields are hard coded as select tags so that we can manually map the numbers to translatable strings. While this appears to work when initially creating an item or applying a template (provided these numbers are stored as strings in the template...) these fields don't display their current values when editing an existing item. This obviously leads to staff confusion and questioning whether the values were set correctly initially.

Revision history for this message
Jason Boyer (jboyer) wrote :

The simple fix for this is to add a new directive to the ui service to convert the model from a number to a string. Since this kind of thing has come up in previous bugs (bug 1713064 and bug 1714390, which conflicted with bug 1712646 because a similar but not identical fix is required) I plan to address it by adding 2 pairs of symmetric directives to the shared egUiMod module; str-to-int and int-to-str, and str-to-float and float-to-str. Additionally the current uses of string-to-number in staff/cat/volcopy/app.js will be converted to the appropriate shared directive and the old string-to-number will be removed.

Revision history for this message
Jason Boyer (jboyer) wrote :

Here's the fix: http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/jboyer/lp1741072-str-num-directives The existing stringToNumber directive is dumped and replaced with 4 directives attached to egUIMod so they can be used everywhere: strToInt and strToFloat, along with the reverse; intToStr and floatToStr. intToStr is necessary to correct this issue, strToFloat corrects issues with price, cost, and deposit, and strToInt will be used to fix bug 1712646. floatToStr is currently unused but included just in case.

Changed in evergreen:
milestone: none → 3.0.3
milestone: 3.0.3 → 3.1-beta
milestone: 3.1-beta → none
tags: added: pullrequest
Changed in evergreen:
milestone: none → 3.0.3
Bill Erickson (berick)
Changed in evergreen:
status: New → Confirmed
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Issue and fixes confirmed. Merged to rel_3_0 and master. Thanks, Jason.

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Bill Erickson (berick) → nobody
Revision history for this message
Bill Erickson (berick) wrote :

Patch results in JS unit test failure:

 ✗ itemSvc.convert_xul_templates converts copy templates as expected

Changed in evergreen:
status: Fix Committed → Incomplete
Revision history for this message
Jason Boyer (jboyer) wrote :

Oh, that would be because I didn't realize a test had been written for that. It's supposed to change also, the reason it was forcing those two fields to be strings was that doing so allowed them to be applied by copy templates. That didn't address the actual issue (select values are always considered strings, even ones matching ^[0-9]*$. With the change to those fields there's no need to special case those two in the conversion process. (with the added benefit that string-ified versions of templates still work with the corrected fields.)

Revision history for this message
Jason Boyer (jboyer) wrote :

What I thought would be a simple test alteration turned into me chasing down the fact that I removed way too much when throwing away the number -> string conversions. The above branch has been force-pushed with an update that alters the test and repairs the conversion function.

Galen Charlton (gmc)
Changed in evergreen:
status: Incomplete → Confirmed
Bill Erickson (berick)
Changed in evergreen:
assignee: nobody → Bill Erickson (berick)
Revision history for this message
Bill Erickson (berick) wrote :

Sign off for Jason's unit test fixes pushed. Branch includes a second commit for replacing "string-to-number" with "str-to-float" on the copy deposit amount field.

http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/berick/lp1741072-str-num-directives-continued

Changed in evergreen:
assignee: Bill Erickson (berick) → nobody
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
importance: Undecided → Medium
tags: added: signedoff
Revision history for this message
Galen Charlton (gmc) wrote :

Tested and pushed to master and rel_3_0. Thanks, Jason and Bill!

Changed in evergreen:
status: Confirmed → Fix Committed
assignee: Galen Charlton (gmc) → nobody
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.