[FOLIO-1333] Loan policy name with space in it cannot be added to a loan rule Created: 09/Jul/18 Updated: 12/Nov/18 Resolved: 21/Aug/18 |
|
| Status: | Closed |
| Project: | FOLIO |
| Components: | None |
| Affects versions: | None |
| Fix versions: | None |
| Type: | Bug | Priority: | P3 |
| Reporter: | Ann-Marie Breaux (Inactive) | Assignee: | Unassigned |
| Resolution: | Won't Do | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original estimate: | Not Specified | ||
| Attachments: |
|
||||||||
| Issue links: |
|
||||||||
| Sprint: | |||||||||
| Description |
|
Overview: Users can create loan policies that have a space in the name of the loan policy, but then when trying to put into a loan rule, the space causes a problem. Steps to Reproduce:
Expected Results: When you get to the space, it should accept that space as part of the loan policy name. Alternatively, when you build the loan policy, if you try to type a space, it should disallow the space, either throwing an error message, or replacing with a hyphen, or something. Actual Results: I could build a loan policy with a space in its name. I could not assign that loan policy with a space into a loan rule. Additional Information: See attached video. |
| Comments |
| Comment by Cate Boerema (Inactive) [ 17/Jul/18 ] |
|
Julian Ladisch, is there some reason we can't have loan policies with spaces? |
| Comment by Julian Ladisch [ 17/Jul/18 ] |
|
Space is the name separator. undergrad grad are two space separated group names. g a b c could be a single group "a b c", the two groups "a" and "b c", the two groups "a b" and "c", or three groups "a", "b" and "c". If we want to allow spaces we must require quotes around space-containing names to show the start and end of the name. For example: g "a b c" is a single group "a b c". |
| Comment by Cate Boerema (Inactive) [ 17/Jul/18 ] |
|
I see... Does that mean we have the same tradeoff with Loan types, Material types, Locations and Patron groups? Either disallow spaces or require quotes in the loan rules? I don't think disallowing spaces is going to appeal to people. Could we use a different separator in Loan rules? Maybe a comma? |
| Comment by Julian Ladisch [ 17/Jul/18 ] |
|
Yes, loan types, material types, locations and patrons groups all have the same requirement regarding forbidden characters. There are four characters that are forbidden in names (unless quoted):
In addition "all" is a special keyword that cannot be used as a name unless quoted. Using comma instead of space inside name lists make the rule more difficult to read: |
| Comment by Cate Boerema (Inactive) [ 17/Jul/18 ] |
|
Hmmm. I see your point about readability with commas, Julian Ladisch. So, let me be sure I understand, our other options:
Honestly, I am not sure either of those are more readable than using a comma separator. Let's try the comma separator with the same values by way of comparison: Yeah, I like the comma separator better in this case. Filip Jakobsen do you have thoughts on this? |
| Comment by Filip Jakobsen [ 17/Jul/18 ] |
|
Cate Boerema, I think both approach 1 and 2 could work. 1 is less prone to error and 2 is easier to read. I would recommend 1 off hand, and (we should do this no matter what) have a human readable version of the loan policy name, as well as a slug version (unambiguous, short, without spaces - e.g. the technical name “grad” or “graduate” or “graduate-student”, for the loan policy with this human readable name “Graduate Student”). I suggest the technical name be generated automatically when entering a human readable name, replacing space for dash, e.g. and that the technical name should still be manually editable. I think the comma separator suggestion is only meaningful when we try to remedy the problems caused by not using approach 1 or 2, and that it doesn’t get to the heart of the issue: using a comma instead would bring some ambiguity, and it would mean people should be prevented from using conmas instead of spaces in the technical names. I can imagine someone wanting to name things like this for human readability: “Student, undergraduate” - “Student, graduate” - “Student, xyz”. In any of these cases, I think it is optimal if people can name the loan type whatever they want in the human readable name field, but would be forced to not use spaces or any punctuation at all in the technical name field. To make it unambiguous. |
| Comment by Cate Boerema (Inactive) [ 17/Jul/18 ] |
|
I guess we disagree here, Filip Jakobsen. I find option 1 difficult to read and I would be annoyed to have to type properties into the loan rules app in this way. I also think adding functionality to auto-generate editable "slug versions" of all of these properties would be significantly more work than just disallowing the use of commas in property names. |
| Comment by Ann-Marie Breaux (Inactive) [ 17/Jul/18 ] |
|
Hi all, Not sure if this is helpful, but I realized when I typed a loan policy name like test policy, behind the scenes, FOLIO was changing it into test-policy, with a hyphen instead of a space. Might that be a reasonable thing to do? If someone types a space, disallow it and replace it with a hyphen in both the UI display (as they are typing) and in the stored name of the loan policy? We already seem to be doing it with the stored name of the policy. We would just need to make the data entry portion of the UI match what's happening behind the scenes. |
| Comment by Julian Ladisch [ 17/Jul/18 ] |
|
Note that we may implement both options 1 and 2 so that staff can decide which option to use. And the options even can be combined, for example: g Undergraduate_student Graduate_student + m "Video recording" DVD : "One hour loan" |
| Comment by Cate Boerema (Inactive) [ 17/Jul/18 ] |
I didn't realize it was doing this and I like it as a simple solution! I see this is happening for material types, as well (e.g. Electronic resources becomes electronic-resources just in Loan rules). Is this a recent change? I can't really jive this behavior with the bug description. Anyway, I like it. Filip Jakobsen, can you live with this for now? |
| Comment by Cate Boerema (Inactive) [ 21/Aug/18 ] |
|
Per comment above, current behavior seems acceptable. Closing this issue. |