Summary: | OAI-PMH mapping value cannot be 0 | ||
---|---|---|---|
Product: | Koha | Reporter: | Mirko Tietgen <mirko> |
Component: | System Administration | Assignee: | Mirko Tietgen <mirko> |
Status: | CLOSED FIXED | QA Contact: | |
Severity: | normal | ||
Priority: | P5 - low | CC: | chris, gmcharlt, mtj, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | Trivial patch | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: | Circulation function: | ||
Bug Depends on: | 8906 | ||
Bug Blocks: | |||
Attachments: |
Bug 9201 OAI-PMH mapping value cannot be 0
Bug 9201 OAI-PMH mapping value cannot be 0 Bug 9201 OAI-PMH mapping value cannot be 0 |
Description
Mirko Tietgen
2012-12-03 19:38:28 UTC
I can confirm this behaviour. The reason is in file admin/oai_set_mappings.pl, line: if($marcfields[$i] and $marcsubfields[$i] and $marcvalues[$i]) I think it should be something like if($marcfields[$i] and $marcsubfields[$i] and ($marcvalues[$i] and $marcvalues ne '')) Created attachment 14108 [details] [review] Bug 9201 OAI-PMH mapping value cannot be 0 Allow the value of a OAI set mapping to be 0 / empty. Delete the mapping if field or subfield are empty. This patch is not touching the .tt file with description that says you need to empty one of these fields. I don't want to interfere with Bug 8906 that deletes this description anyway. Marking this bug as dependant on 8906 for that reason. Created attachment 14271 [details] [review] Bug 9201 OAI-PMH mapping value cannot be 0 Allow the value of a OAI set mapping to be 0 / empty. Delete the mapping if field or subfield are empty. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Now it is possible to add a value == 0 or an empty string. Created attachment 14940 [details] [review] Bug 9201 OAI-PMH mapping value cannot be 0 Allow the value of a OAI set mapping to be 0 / empty. Delete the mapping if field or subfield are empty. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Now it is possible to add a value == 0 or an empty string. Signed-off-by: Mason James <mtj@kohaaloha.com> (In reply to comment #5) > Created attachment 14940 [details] [review] > Bug 9201 OAI-PMH mapping value cannot be 0 > > Allow the value of a OAI set mapping to be 0 / empty. Delete the mapping if > field or subfield are empty. > > Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> > Now it is possible to add a value == 0 or an empty string. > Signed-off-by: Mason James <mtj@kohaaloha.com> passing QA, works as expected... Before I can push this, bug 8906 will have to be QAed. I will also need a detailed test plan so I can confirm that it actually works. Before applying the patch: Go to Administration > OAI sets configuration Choose »Add a new set« setSpec: aaa setName: bbb Save Choose »Define mappings« for your new set. Enter »Field«: 100, »Subfield«: a, »Value«: 0 Click »Save« and see »Warning: no mappings defined for this set« Apply patch Enter field: 100, subfield: a, value: 0 Click »Save« and see that your mapping is saved This patch has been pushed to master. I spoke with Mirko, and he clarified that the functionality does not depend on Bug 8906, so I am pushing this patch now. Pushed to 3.10.x and 3.8.x will be in 3.10.3 and 3.8.10 |