Bug 39934

Summary: Standard backend shows attributes from previously "migrated from" backends
Product: Koha Reporter: Pedro Amorim <pedro.amorim>
Component: ILLAssignee: Pedro Amorim <pedro.amorim>
Status: Needs Signoff --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: pedro.amorim, tomascohen
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=38341
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 39934: Only fetch attributes from 'Standard'
Bug 39934: Use _get_core_fields as fields to be migrated
Bug 39934: Add tests

Description Pedro Amorim 2025-05-19 10:36:45 UTC

    
Comment 1 Pedro Amorim 2025-05-19 10:44:39 UTC
Created attachment 182581 [details] [review]
Bug 39934: Only fetch attributes from 'Standard'

Furthermore, this now only shows metadata present in _get_core_fields,
so a list of attributes to ignore is not longer needed (they're not in
_get_core_fields).
Comment 2 Pedro Amorim 2025-05-19 10:44:42 UTC
Created attachment 182582 [details] [review]
Bug 39934: Use _get_core_fields as fields to be migrated

Instead of ignoring from an arbitrary list
Comment 3 Pedro Amorim 2025-05-19 10:44:44 UTC
Created attachment 182583 [details] [review]
Bug 39934: Add tests

prove t/db_dependent/Koha/ILL/Backend/Standard.t

Test plan, k-t-d, don't apply patches yet:
1) Enable ILLModule sys pref
2) Install an additional backend, e.g. ReprintsDesk:
https://github.com/openfifth/koha-ill-reprintsdesk/releases/tag/v3.0.2
3) Restart plack
$ koha-plack --restart kohadev
4) Create a new ReprintsDesk request, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl?method=create&backend=ReprintsDesk
5) Enter DOI: '123', EISSN: 'abc', a cardnumber '42' and a library. Click 'Make request'
6) Click 'Switch provider'. Pick 'Standard'.
7) Notice 'Eissn' shows. This is confusing as it means nothing in the 'Standard' context. 'Migrated from' is also shown and is equally as confusing for staff members (This is a remnant of previous behavior when migrating a request would create a new request).
8) Apply patches. Repeat test plan. The attributes from the previous backend still exist in the database, but the UI now only shows attributes relevant to the current backend of the request. To confirm this, run:
$ koha-mysql kohadev
$ select * from illrequestattributes;