Bug 13727 - Validation of authorized values
Summary: Validation of authorized values
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-18 13:42 UTC by Rurik Greenall
Modified: 2015-02-24 19:32 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rurik Greenall 2015-02-18 13:42:39 UTC
While automatically testing item creation, we added randomized alphanumeric values to NOT_LOAN. When we attempted to add NOT_LOAN statuses to items, we found that Koha did one of two things:

1) allowed us to set the status in the interface, but failed silently
2) allowed us to set the status, but added only part of the value

REPLICATION:

Type one:

1) create a new authorized value for category NOT_LOAN
2) add a value (value: "abc1de", description: "new1", OPAC description: "New 1")
3) create new item
4) set Not for loan to "New 1"

Result: Item's "Not for loan" status is ""

Type two:

1) create a new authorized value for category NOT_LOAN
2) add a value (value: "12abce", description: "new2", OPAC description: "New 2")
3) create new item
4) set Not for loan to "New 2"

Result: Item's "Not for loan" status is 12

We notice that the documentation clearly states that the values of NOT_LOAN must not be alphabetical http://manual.koha-community.org/3.18/en/basicparams.html#notforloan however, we would argue that the ability to set values opens for an expectation that they should be usable.

In terms of a fix, it is possible to add a validation pattern to the authorized value at creation time; which is then stored in the table with the value and can be used to validate entry via the jQuery validation plugin and a html5 data-field.