Bug 32797 - Cannot save OAI set mapping rule for subfield 0
Summary: Cannot save OAI set mapping rule for subfield 0
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Nick Clemens (kidclamp)
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-02 14:56 UTC by Nick Clemens (kidclamp)
Modified: 2023-12-28 20:44 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.03,22.05.10,21.11.16
Circulation function:


Attachments
Bug 32797: Check if fields have a value, not if true (1.20 KB, patch)
2023-02-02 14:59 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 32797: Check if fields have a value, not if true (1.25 KB, patch)
2023-02-02 19:53 UTC, David Nind
Details | Diff | Splinter Review
Bug 32797: Check if fields have a value, not if true (1.35 KB, patch)
2023-02-03 07:24 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2023-02-02 14:56:50 UTC
The code checks the truth of the subfield, it should check if not empty
Comment 1 Nick Clemens (kidclamp) 2023-02-02 14:59:29 UTC
Created attachment 146011 [details] [review]
Bug 32797: Check if fields have a value, not if true

When saving OAI set mappgins we are checking for truth, this prevents
saving subfield 0. We should check for content

To test:
1 - Go to Admin->OAI sets
2 - Create a set
3 - Define mappings for the set
4 - Attempt to save a rule on field 952 subfield 0 (withdrawn)
5 - It does not save
6 - Apply patch
7 - Try again
8 - Success!
Comment 2 David Nind 2023-02-02 19:53:05 UTC
Created attachment 146029 [details] [review]
Bug 32797: Check if fields have a value, not if true

When saving OAI set mappgins we are checking for truth, this prevents
saving subfield 0. We should check for content

To test:
1 - Go to Admin->OAI sets
2 - Create a set
3 - Define mappings for the set
4 - Attempt to save a rule on field 952 subfield 0 (withdrawn)
5 - It does not save
6 - Apply patch
7 - Try again
8 - Success!

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2023-02-03 07:24:36 UTC
Created attachment 146059 [details] [review]
Bug 32797: Check if fields have a value, not if true

When saving OAI set mappgins we are checking for truth, this prevents
saving subfield 0. We should check for content

To test:
1 - Go to Admin->OAI sets
2 - Create a set
3 - Define mappings for the set
4 - Attempt to save a rule on field 952 subfield 0 (withdrawn)
5 - It does not save
6 - Apply patch
7 - Try again
8 - Success!

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Tomás Cohen Arazi (tcohen) 2023-02-03 13:33:35 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 5 Jacob O'Mara 2023-02-06 15:58:52 UTC
Nice work, thanks everyone!

Pushed to 22.11.x for the next release.
Comment 6 Lucas Gass (lukeg) 2023-02-14 22:01:25 UTC
Backported to 22.05.x for upcoming 22.05.10
Comment 7 Arthur Suzuki 2023-02-17 10:10:55 UTC
applied to 21.11.x for 21.11.16
Comment 8 Wainui Witika-Park 2023-03-15 01:44:57 UTC
Not backported to 21.05.x