Bug 34989 - Subscription cannot be added if a control field is set up in "Additional Fields" parameter
Summary: Subscription cannot be added if a control field is set up in "Additional Fiel...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Baptiste Wojtkowski (bwoj)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-10-05 09:26 UTC by Anke Bruns
Modified: 2024-11-10 18:55 UTC (History)
2 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:
Circulation function:


Attachments
Bug 34989: Subscription cannot be added if a control field is set up in "Additional Fields" parameter (2.28 KB, patch)
2024-10-31 11:42 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review
Bug 34989: Subscription cannot be added if a control field is set up in "Additional Fields" parameter (2.36 KB, patch)
2024-10-31 11:47 UTC, Baptiste Wojtkowski (bwoj)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Anke Bruns 2023-10-05 09:26:49 UTC
Subscriptions can't be created because of an HTTP 500 and the following message in the plack error log:

"Control fields (generally, just tags below 010) do not have subfields, use data() at /usr/share/koha/lib/Koha/Object/Mixin/AdditionalFields.pm line 68."

The workaround by Joubu (many thanks!) in the Koha chat was to look whether in

Administration > Additional fields > Table 'subscription'
(/cgi-bin/koha/admin/additional-fields.pl?tablename=subscription)

a MARC field was present that was a control field (ie. without $ field/subfield separator). We indeed had a 001 configured there with MARC field mode "Get value from MARC record" and Searchable=Yes

Removing this solved the problem, but perhaps subscriptions should also work if a control field is configured in the place mentioned above?

Another thing is that we are not completely sure if the error was produced when we upgraded from 22.05 or if it was present there as well with the additional field set.
Comment 1 Katrin Fischer 2023-10-29 13:46:06 UTC
Confirmed in current development version. Tested with 001 and 001@. It would be nice if we could add support as the 001 would be really useful.
Comment 2 Baptiste Wojtkowski (bwoj) 2024-10-31 11:42:48 UTC Comment hidden (obsolete)
Comment 3 Baptiste Wojtkowski (bwoj) 2024-10-31 11:47:04 UTC
Created attachment 173778 [details] [review]
Bug 34989: Subscription cannot be added if a control field is set up in "Additional Fields" parameter

Test plan for MARC21:
1 - Create a subscription
2 - Go to administration -> aditional fields add a field for any CONTROL
  field existing in your subscription for example 005
3 - Also create an additional field for 245$a (check non regression)
4 - On the subscription page: Edit -> Edit subscription -> Next
  -> Save subscription -> You get: "Internal server error"
5 - Apply patch
6 - Repeat 4, you have no error anymore. On the subscription page you
  can see both additional fields.
Comment 4 David Nind 2024-11-10 18:55:57 UTC
I couldn't replicate the issue - steps 2-5.

The subscription I created had an 001 and 005 value in the record.

What I entered in the additional field form (for the subscription table):
- Name: BZ34989-1
- Authorized value category: None
- Repeatable: left blank
- MARC field: 005
- MARC field mode: Get value from MARC record (not modifiable)
- Searchable: selected