Bug 16204 - Show friendly error message when trying to edit record which no longer exists
Summary: Show friendly error message when trying to edit record which no longer exists
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Aleisha Amohia
QA Contact: Testopia
URL: /cgi-bin/koha/cataloguing/addbiblio.p...
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-05 14:06 UTC by Owen Leonard
Modified: 2019-10-14 19:56 UTC (History)
7 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16204: Show friendly error message if trying to edit record which no longer exists (2.78 KB, patch)
2017-08-30 04:39 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 16204: Show friendly error message if trying to edit record which no longer exists (2.84 KB, patch)
2017-09-12 07:00 UTC, Claire Gravely
Details | Diff | Splinter Review
Bug 16204: Show friendly error message if trying to edit record which no longer exists (2.92 KB, patch)
2017-09-19 14:23 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2016-04-05 14:06:30 UTC
If you pass a non-existent biblionumber to addbiblio.pl you will get an error message: 

Can't call method "title" on an undefined value at /cataloguing/addbiblio.pl line 814.

This might happen if you click an edit link from search results which are out of date or if you have saved the results of a report.

Koha should show a friendlier error message.
Comment 1 Aleisha Amohia 2017-08-30 04:39:12 UTC
Created attachment 66608 [details] [review]
Bug 16204: Show friendly error message if trying to edit record which no longer exists

To test:
1) Create a record
2) Click Edit -> Edit record. open this in another tab
3) Delete the record in the original tab
4) Refresh the edit form in the other tab. Notice the software error
5) Apply patch and refresh page
6) There should be a nice error message with the form fields and buttons
hidden. Confirm links work as expected.

Sponsored-by: Catalyst IT
Comment 2 Claire Gravely 2017-09-12 07:00:43 UTC
Created attachment 67072 [details] [review]
Bug 16204: Show friendly error message if trying to edit record which no longer exists

To test:
1) Create a record
2) Click Edit -> Edit record. open this in another tab
3) Delete the record in the original tab
4) Refresh the edit form in the other tab. Notice the software error
5) Apply patch and refresh page
6) There should be a nice error message with the form fields and buttons
hidden. Confirm links work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>
Comment 3 Jonathan Druart 2017-09-19 14:21:12 UTC
If someone plans to touch all cataloguing and catalogue pl scripts, please use a redirect (see pattern on bug 19080).
Comment 4 Jonathan Druart 2017-09-19 14:23:37 UTC
Created attachment 67212 [details] [review]
Bug 16204: Show friendly error message if trying to edit record which no longer exists

To test:
1) Create a record
2) Click Edit -> Edit record. open this in another tab
3) Delete the record in the original tab
4) Refresh the edit form in the other tab. Notice the software error
5) Apply patch and refresh page
6) There should be a nice error message with the form fields and buttons
hidden. Confirm links work as expected.

Sponsored-by: Catalyst IT
Signed-off-by: Claire Gravely <claire.gravely@bsz-bw.de>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 5 Jonathan Druart 2017-09-19 14:49:11 UTC
Pushed to master for 17.11, thanks to everybody involved!
Comment 6 Fridolin Somers 2017-10-23 15:01:18 UTC
Pushed to 17.05.x, will be in 17.05.06.
Comment 7 Katrin Fischer 2017-10-29 18:05:37 UTC
This patch has been pushed to 16.11.x and will be in 16.11.14.
Comment 8 Mason James 2017-11-23 23:21:20 UTC
Pushed to 16.05.x, for 16.05.19 release