Bug 16204

Summary: Show friendly error message when trying to edit record which no longer exists
Product: Koha Reporter: Owen Leonard <oleonard>
Component: CatalogingAssignee: Aleisha Amohia <aleisha>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: aleisha, fridolin.somers, jonathan.druart, josef.moravec, katrin.fischer, m.de.rooy, mtj
Version: Main   
Hardware: All   
OS: All   
URL: /cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=X
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
Bug 16204: Show friendly error message if trying to edit record which no longer exists
Bug 16204: Show friendly error message if trying to edit record which no longer exists

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