Bug 5428

Summary: Back to results after deleting a record
Product: Koha Reporter: Zachary Spalding <spalding>
Component: CatalogingAssignee: Jonathan Druart <jonathan.druart>
Status: RESOLVED FIXED QA Contact: Bugs List <koha-bugs>
Severity: enhancement    
Priority: P5 - low CC: chris, jonathan.druart, katrin.fischer, koha.sekjal, koha, lucas, martin.renvoize, Niamh.WalkerHeadon, nick, paul.a, veron
Version: master   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34506
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
After deleting a bibliographic record in the cataloguing module the cataloguer will now be redirected back to the search results list if they had any, instead of the empty search form.
Version(s) released in:
20.11.00
Bug Depends on:    
Bug Blocks: 34506    
Attachments: Bug 5428: Jump back to the search result after deleting a record
Bug 5428: Jump back to the search result after deleting a record
Bug 5428: Jump back to the search result after deleting a record
Bug 5428: Jump back to the search result after deleting a record
Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch
Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch
Bug 5428: Add searchid to the "Return to the record" button (batch del)

Description Zachary Spalding 2010-11-23 18:30:05 UTC
After deleting a bib record in the cataloging module your our redirect back to a search screen.  It would be more helpful if the cataloger was redirect back to the search results list if they had any and not have to conduct another search again.
Comment 1 Paul A 2013-06-24 12:50:57 UTC
Confirmed as a most useful timesaver by our cataloguers (3.8.5). -- Paul
Comment 2 Marc VĂ©ron 2015-06-02 12:42:02 UTC
There is a nice workaround:

- From Search results or detail display, add items to your cart
- Open cart and make use of "Batch delete"
Comment 3 Katrin Fischer 2019-05-04 19:12:53 UTC
*** Bug 3005 has been marked as a duplicate of this bug. ***
Comment 4 Katrin Fischer 2019-05-04 19:14:40 UTC
Bug 3005 asked for a success message on deleting a record. Could we imagine to factor this wish in here somehow? Maybe we could display a modal and let the user decide where they want to go after successful deletion? Or display a success message on the page we redirect to.
Comment 5 Jonathan Druart 2020-08-04 12:41:13 UTC
Created attachment 107753 [details] [review]
Bug 5428: Jump back to the search result after deleting a record

This patch adds the ability to jump back to the search result after a
record has been deleted.
Also it keeps the "browser" when all items are deleted from a
bibliographic record

Test plan:
- Start a new search
- Select a record with items
- Delete all the items
=> You still see the browser
- Delete the record
=> You are back to the adv search form but we new link "Go back to the
results" is present at the top of the page

Limitation: As we delete the record we do not longer know the offset,
we are back to the first page of the result list
Comment 6 Martin Renvoize 2020-08-05 16:09:11 UTC
(In reply to Jonathan Druart from comment #5)

> - Delete the record
> => You are back to the adv search form but we new link "Go back to the
> results" is present at the top of the page

I'm not seeing the 'Go back to the results' link anywhere on the advanced search page after applying this patch and following the above step.
Comment 7 Jonathan Druart 2020-08-06 08:01:08 UTC
Created attachment 107866 [details] [review]
Bug 5428: Jump back to the search result after deleting a record

This patch adds the ability to jump back to the search result after a
record has been deleted.
Also it keeps the "browser" when all items are deleted from a
bibliographic record

Test plan:
- Start a new search
- Select a record with items
- Delete all the items
=> You still see the browser
- Delete the record
=> You are back to the adv search form but we new link "Go back to the
results" is present at the top of the page

Limitation: As we delete the record we do not longer know the offset,
we are back to the first page of the result list
Comment 8 Martin Renvoize 2020-08-06 08:07:53 UTC
Created attachment 107868 [details] [review]
Bug 5428: Jump back to the search result after deleting a record

This patch adds the ability to jump back to the search result after a
record has been deleted.
Also it keeps the "browser" when all items are deleted from a
bibliographic record

Test plan:
- Start a new search
- Select a record with items
- Delete all the items
=> You still see the browser
- Delete the record
=> You are back to the adv search form but we new link "Go back to the
results" is present at the top of the page

Limitation: As we delete the record we do not longer know the offset,
we are back to the first page of the result list

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2020-08-06 08:11:21 UTC
This now works as described so I'm signing off..  

However, I wonder if it might be nicer reverse the logic and redirect back to the search results by default instead of redirected to advanced search and displaying a button to get to the prior results...
Comment 10 Nick Clemens 2020-08-07 00:43:55 UTC
Created attachment 107933 [details] [review]
Bug 5428: Jump back to the search result after deleting a record

This patch adds the ability to jump back to the search result after a
record has been deleted.
Also it keeps the "browser" when all items are deleted from a
bibliographic record

Test plan:
- Start a new search
- Select a record with items
- Delete all the items
=> You still see the browser
- Delete the record
=> You are back to the adv search form but we new link "Go back to the
results" is present at the top of the page

Limitation: As we delete the record we do not longer know the offset,
we are back to the first page of the result list

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 11 Nick Clemens 2020-08-07 00:43:58 UTC
Created attachment 107934 [details] [review]
Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 12 Nick Clemens 2020-08-07 00:45:42 UTC
(In reply to Martin Renvoize from comment #9)
> This now works as described so I'm signing off..  
> 
> However, I wonder if it might be nicer reverse the logic and redirect back
> to the search results by default instead of redirected to advanced search
> and displaying a button to get to the prior results...

I agree, it sent me down a path of adding this in other places, but I think we should file a new bug. 

If my follow-up looks good I am of the mindset to call this one a good enhancement after 10 years of waiting, and to do further enhancements on the next one.
Comment 13 Jonathan Druart 2020-08-07 07:08:15 UTC
Nick, your patch does not work for me, can you double check?

searchid is not passed the batchMod.pl
Comment 14 Nick Clemens 2020-08-11 11:17:33 UTC
(In reply to Jonathan Druart from comment #13)
> Nick, your patch does not work for me, can you double check?
> 
> searchid is not passed the batchMod.pl

it works for me

the links don't have searchid, however, there is js that adds it when you use the links in the Edit dropdown
Comment 15 Jonathan Druart 2020-08-12 09:22:22 UTC
Nick, please provide a test plan for this last patch. What I am doing:

Do a search
select a record
select items in the holdings table, click "Modify selected items"
I am on /tools/batchMod.pl?op=show&itemnumber=37&itemnumber=36&biblionumber=14&src=CATALOGUING (not that searchid is missing)
click save
=> https://snipboard.io/lKhRQa.jpg
None of the 2 "Return to the record link" has the searchid
None of the 2 links redirect me to the detail view with the browser.
Comment 16 Nick Clemens 2020-08-12 11:18:17 UTC
Created attachment 108096 [details] [review]
Bug 5428: (QA follow-up) Add searchid for deleting items in a batch and editing in batch

To test:
0 - Perform a search in the staff client
1 - Click a title to go to the details page for a record
2 - Click the 'Edit' button and select 'Edit items in a batch'
3 - Note the searchid is in the url
4 - Make a change and hit 'Save'
5 - Note the 'Return the the record' link at the top, and the button on the bottom include searchid in URL
6 - Click one and note the brwoser is stil there
7 - Click 'Edit' and select 'Delete items in a batch'
8 - Delete one item
9 - Click return to record
10 - Browser is there
11 - Click 'Delete items in a batch again
12 - Select all and check 'Delete records if no items remain'
13 - Delete them
14 - Note you have a link to 'Go back to the results'

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 17 Jonathan Druart 2020-08-12 12:03:39 UTC
Created attachment 108099 [details] [review]
Bug 5428: Add searchid to the "Return to the record" button (batch del)
Comment 18 Jonathan Druart 2020-08-13 05:56:50 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 19 Lucas Gass 2020-08-17 15:32:00 UTC
enhancement will not be backported to 20.05.x
Comment 20 Mark Hofstetter 2023-08-09 07:35:53 UTC
the link 'Go back to the results' has disappeared at least up to 22.11.06.005 (maybe some changes in the js or the dom)
Comment 21 Katrin Fischer 2023-08-09 07:55:16 UTC
(In reply to Mark Hofstetter from comment #20)
> the link 'Go back to the results' has disappeared at least up to
> 22.11.06.005 (maybe some changes in the js or the dom)

Hi Mark, please open a new bug and use the depends on to link to this one. Once something has been released, we always need a new bug for the patches.
Comment 22 Katrin Fischer 2023-10-29 09:25:34 UTC
Closing the bug again as bug 34506 has been filed.