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.
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.
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.
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"'
Still applies
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>
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>
Pushed to master for 21.11, thanks to everybody involved!