Bug 22614

Summary: Request migration from one backend to another should not create new request
Product: Koha Reporter: Andrew Isherwood <bugzilla>
Component: ILLAssignee: Andrew Isherwood <bugzilla>
Status: CLOSED FIXED QA Contact: Nick Clemens <nick>
Severity: normal    
Priority: P5 - low CC: janet.mcgowan, jonathan.druart, katrin.fischer, kyle, magnus, martin.renvoize, Niamh.WalkerHeadon, nick
Version: master   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
21.11.00
Attachments: Bug 22614: Migrate original request
Bug 22614: Migrate original request
Bug 22614: Migrate original request
Bug 22614: Migrate original request

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
Comment 5 Martin Renvoize 2021-07-07 08:43:35 UTC
Created attachment 122645 [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.

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Assumpta Byrne <abyrne@ait.ie>
Comment 6 Nick Clemens 2021-07-30 18:54:31 UTC
Created attachment 123342 [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.

Signed-off-by: Barry Cannon <bc@interleaf.ie>
Signed-off-by: Assumpta Byrne <abyrne@ait.ie>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 7 Jonathan Druart 2021-09-21 18:18:29 UTC
Pushed to master for 21.11, thanks to everybody involved!