Currently, once an ILL request has started on a path in one backend it cannot be migrated to another. We should allow the status graph to be modified with 'MoveFrom' and 'MoveTo' methods allowing a request to be migrated from one backend to another when both backend support it (and when the request hasn't progressed sufficiently in one backend to prevent cancellation)
Created attachment 74903 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
I've added support for this functionality to the Koha2Koha backend (yet to be released publically) and the FreeForm backend. I'm currently working on adding support to the BLDSS backend too. Once these are all in place we can test the core functionality using them.
Created attachment 75430 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Created attachment 75431 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Created attachment 78525 [details] [review] Commit reflecting changes in: https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74903&action=diff
Rebased on current master
Comment on attachment 78525 [details] [review] Commit reflecting changes in: This patch is just a repeat of the initial patch
Created attachment 79508 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Created attachment 79571 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Another rebase.. what fun this is :)
I'm getting an error when I click the "Switch provider" button: Duplicate ID at /usr/share/perl5/Exception/Class/Base.pm line 73 I thought it might be a problem with my test data, but after emptying illrequests and illrequestattributes and starting from scratch I still got the error. Note: You might want to rebase this on Bug 21377 and make it dependent.
Also: Please add a test plan!
Created attachment 79597 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Just as a side note, I have a library that is interested in being able to move things from purchase sugestions to ILL and from ILL to purchase suggestions.
(In reply to Magnus Enger from comment #14) > Just as a side note, I have a library that is interested in being able to > move things from purchase sugestions to ILL and from ILL to purchase > suggestions. I think that'll need to be another bug Magnus.. nice idea though.. feel free to stick a bug in for it and we might get to it at some point.. there's still a big pile in our internal dev queue for ILL ;)
Testing To test this, you must have at least 2 supported backends installed and configured. (Currently, the FreeForm and Koha2Koha backends have both been confirmed to work, and I am currently completing the work on the BLDSS backend). Once you have two backends installed and working the test plan is: 1) Create an ILL request using your prefered, supported, backend 2) Go to the 'Manage request' page for your new request 3) Confirm that a 'Switch provider' button exists 3a) If only one other backend is installed and configured the button will be a button 3b) If multiple backends are installed the button allow dropdown selection of alternate backends 4) Select the backend to migrate to using the 'Switch provider' button. 5) Depending on the backend you have selected to move to, you will be faced with a compatible workflow for migrating the request.. either a new request consisting of the same details as the original request, a search results page from the migrating to backend (with results reflecting a pre-fired search using details from the migrating from request) or a search form pre-filled with the details of the request your migrating from which you can then submit 6) Finally, once you've moved through the steps to create this migrated to request, you should see a new request in your migrated to backend and the original request will be marked as 'Request reverted'.
Tried to create a Koha request and it throws an error. Created a Freeform request instead. It throws this error: DataTables warning: table id=ill-requests - Requested unknown parameter 'metadata_author' for row 0, column 0. For more information about this error, please see http://datatables.net/tn/4 but continues to create the request ok. It completed the Freeform request. Switch provider button exists with the other two backends listed on the dropdown. Tested switching to BLDSS and next screen is presented as expected. "Request reverted" listed for original request. New request to switched provider listed correctly. List Requests shows above error also. Request number on list requests screen is always Nan, whereas correct request number is listed on Manage Request screen. Created a BLDSS request and switched to Freeform successfully but above error generated on Switch Provider action.
Hi Martin Thanks very much for this. The datatables error you're seeing is a known issue. It's due to you not having entered an author for some requests, it's not actually an issue with this bug, bug 21063 fixes it. The request number being Nan is also fixed with bug 21063 and isn't caused by this bug. I hope that makes sense, if not, let me know!
Created attachment 80900 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends. Signed-off-by: Martin McGovern <mmg@interleaf.ie>
When I click "Switch provider" button, there is error: DBD::mysql::st execute failed: Duplicate entry '876-article_pages' for key 'PRIMARY' [for Statement "INSERT INTO `illrequestattributes` ( `illrequest_id`, `type`, `value`) VALUES ( ?, ?, ? )" with ParamValues: 0='876', 1='article_pages', 2='pp. 15-19'] at /usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1832. Duplicate ID
Created attachment 81826 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Created attachment 81827 [details] [review] Bug 20640: (follow-up) Degrade gracefully on error
I've added a more graceful failure mode should a backend fail to load or fail to support the migrate action.
Created attachment 83777 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends.
Created attachment 83778 [details] [review] Bug 20640: (follow-up) Degrade gracefully on error
Created attachment 83779 [details] [review] Bug 20640: (follow-up) Redirect to new request at completion
Created attachment 83797 [details] [review] Bug 20640: (follow-up) Make error message translatable
Created attachment 83798 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends. Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83799 [details] [review] Bug 20640: (follow-up) Degrade gracefully on error Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83800 [details] [review] Bug 20640: (follow-up) Redirect to new request at completion Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83801 [details] [review] Bug 20640: (follow-up) Make error message translatable Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Found another issue - setting to FQA waiting for news from Martin.
Created attachment 83803 [details] [review] Bug 20640: (follow-up) Make error message translatable
Should be ready again for testing now
Created attachment 83805 [details] [review] Bug 20640: (follow-up) Always send a backend on migrate
Created attachment 83806 [details] [review] Bug 20640: Add backend migration support to ILL - Add core methods required to support the migration of ILL requests between backends. Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83807 [details] [review] Bug 20640: (follow-up) Degrade gracefully on error Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83808 [details] [review] Bug 20640: (follow-up) Redirect to new request at completion Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83809 [details] [review] Bug 20640: (follow-up) Make error message translatable Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Created attachment 83810 [details] [review] Bug 20640: (follow-up) Always send a backend on migrate Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
Awesome work all! Pushed to master for 19.05
This will not be backported to 18.11.x series.