The search box on the holds history table throws a 500 error when the item type column is visible Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown
Created attachment 190519 [details] [review] Bug 41451: Set correct embed and column property for itemtypes in the holds history table Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown 7) Apply patch and run yarn api:bundle && restart_all 8) Repeat step 5, the search should now work correctly
I can reproduce the 500 error. However, after applying the patch (+ yarn build, restart_all, delete browser history, and so on), the holds history page just sits with "Processing" for the current holds table. In the developer tools browser console I'm getting: Uncaught TypeError: Cannot read properties of null (reading 'itemtype')
Created attachment 190532 [details] [review] Bug 41451: Set correct embed and column property for itemtypes in the holds history table Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown 7) Apply patch and run yarn api:bundle && restart_all 8) Repeat step 5, the search should now work correctly
Created attachment 190533 [details] [review] Bug 41451: Set correct embed and column property for itemtypes in the holds history table Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown 7) Apply patch and run yarn api:bundle && restart_all 8) Repeat step 5, the search should now work correctly Signed-off-by: David Nind <david@davidnind.com>
This patch is not correct, it's not the item's item_type but the hold's item_type.
Created attachment 190536 [details] [review] Bug 41451: Prevent 500 when searching hold history It explodes if the "Item type" column is displayed (ie. if AllowHoldItemTypeSelection is set). Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown 7) Apply patch 8) Repeat step 5, the search should now work correctly Note that a couple of other bugs will be fixed on follow-up bug reports.
I've found way too many things that didn't work so I've decided to fix the 500 on this bug report to ease backport, then follow-up on separate bug reports.
Created attachment 190552 [details] [review] Bug 41451: Prevent 500 when searching hold history It explodes if the "Item type" column is displayed (ie. if AllowHoldItemTypeSelection is set). Test plan: 1) Create at least one hold on any record 2) Navigate to the patron who has the hold and click Holds history in the left menu 3) The table should load correctly and the search bar above it should work 4) In system preferences, enable AllowHoldItemTypeSelection 5) Refresh the holds history, the Requested item type column should now be visible 6) Try a search, a 500 error should be thrown 7) Apply patch 8) Repeat step 5, the search should now work correctly Note that a couple of other bugs will be fixed on follow-up bug reports. Signed-off-by: David Nind <david@davidnind.com>