Bug 22614 - Request migration from one backend to another should not create new request
Summary: Request migration from one backend to another should not create new request
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Andrew Isherwood
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-01 13:06 UTC by Andrew Isherwood
Modified: 2021-06-08 08:17 UTC (History)
5 users (show)

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


Attachments
Bug 22614: Migrate original request (2.06 KB, patch)
2019-04-01 13:14 UTC, Andrew Isherwood
Details | Diff | Splinter Review
Bug 22614: Migrate original request (2.71 KB, patch)
2019-04-03 14:27 UTC, Andrew Isherwood
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Isherwood 2019-04-01 13:06:16 UTC
Currently, when requests are migrated from one backend to another, a new request is created containing the attributes of the existing one but with the backend set to the migration destination backend and the metadata is derived from the migration destination backend. The existing request is then marked as reverted and a record is made of where the request was migrated to.

The downside of this approach is that two requests now exist in the system, whereas in actual fact, it's still the same request. This can be problematic for statistics etc.

This bug proposes that request migration should preserve the original request and, instead, change its backend and replace the metadata from the original backend to that of the migration destination backend. Also, we should log where the request has been migrated from and to.
Comment 1 Andrew Isherwood 2019-04-01 13:14:04 UTC
Created attachment 87277 [details] [review]
Bug 22614: Migrate original request

This patch changes an active request's backend and initiates the
migration on that request, rather than creating another and migrating
that.

The majority of the work to accomplish this bug is being carried out in
the backends, since Koha delegates migrations to them.
Comment 2 Andrew Isherwood 2019-04-03 14:27:14 UTC
Created attachment 87357 [details] [review]
Bug 22614: Migrate original request

This patch changes an active request's backend and initiates the
migration on that request, rather than creating another and migrating
that.

The majority of the work to accomplish this bug is being carried out in
the backends, since Koha delegates migrations to them.
Comment 3 Andrew Isherwood 2019-04-04 09:43:39 UTC
Test plan:

- Apply the patch
- Install the FreeForm and BLDSS backends (note, these links are to the 'bug_22614_migrate_original_request' branches for these backends):
  - https://github.com/PTFS-Europe/koha-ill-bldss/tree/bug_22614_migrate_original_request
  - https://github.com/PTFS-Europe/koha-ill-freeform/tree/bug_22614_migrate_original_request
- Create a request using the FreeForm backend.
- On the "Manage request" screen, choose "Switch provider" > "BLDSS"
- Choose an appropriate search result from the BLDSS results
- TEST => Observe that the request is now displaying as originating from the BLDSS and containing metadata from the BLDSS.
- Choose "ILL request log"
- TEST => Observe that the log displays 'Status changed from "New request" to "Switched provider"'
- TEST => Observe that the log displays 'Switched provider from "FreeForm" to "BLDSS"'
- Create a request using the BLDSS backend.
- On the "Manage request" screen, choose "Switch provider" > "FreeForm"
- TEST => Observe that the request is now displaying as originating from FreeForm and has preserved the BLDSS metadata.
- Choose "ILL request log"
- TEST => Observe that the log displays 'Status changed from "New request" to "Switched provider"'
- TEST => Observe that the log displays 'Switched provider from "BLDSS" to "FreeForm"'
Comment 4 Martin Renvoize 2021-03-19 14:20:04 UTC
Still applies