When a biblio/authority is deleted, and for some reason one tries to access it via a (saved) URL (as when you reach the link via log viewer) koha presents the user a very ugly system error:
Can't call method "field" on an undefined value at /home/tomas/Work/koha/devel/koha-community-3.2.x/authorities/detail.pl line 82.
This is correctly handled for patrons, presenting a convenient "This patron does not exist." A similar approach should be implemented for biblios AND authorities.
I was pointed in the IRC that 404 error vs. error message is an open issue, as of bug #2318. I attach my proposed patch, and wait for a discussion on this topic in koha devel.
I've already sent an email on this.
Created attachment 3194 [details] [review]
This bug is mentioned in:
[Bug 5791] Robust handling of deleted biblios/authorities http://lists.koha-community.org/pipermail/koha-patches/2011-February/013913.html
I suggest the term "biblio" be replaced with "record" in catalogue/detail.tmpl, and "authority" be "authority record" in authorities/detail.tmpl.
Other pages also need work in order for this bug to be completely fixed: catalogue/ISBDdetail.tmpl, catalogue/MARCdetail, and catalogue/labeledMARCdetail.pl
Created attachment 3272 [details] [review]
(1/2) follow-up - owen suggestions for text
Created attachment 3273 [details] [review]
(2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail
This bug is mentioned in:
[Bug 5791] Robust handling of deleted biblios/authorities http://lists.koha-community.org/pipermail/koha-patches/2011-March/014012.html
[Bug 5791] Robust handling of deleted biblios/authorities http://lists.koha-community.org/pipermail/koha-patches/2011-March/014014.html
[Bug 5791] (2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail http://lists.koha-community.org/pipermail/koha-patches/2011-March/014013.html
I have some merge conflicts while applying the first 'Initial patch':
Apply? [y]es/[n]o/[e]dit/[v]iew patch/[a]ccept all y
Applying: Robust handling of deleted biblios/authorities
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
CONFLICT (content): Merge conflict in authorities/detail.pl
Failed to merge in the changes.
Patch failed at 0001 Robust handling of deleted biblios/authorities
When you have resolved this problem run "git am -i -3 --resolved".
If you would prefer to skip this patch, instead run "git am -i -3 --skip".
To restore the original branch and stop patching run "git am -i -3 --abort".
[katrin@wombat kohaclone (oth_5791_nice_error|AM)]$git status
Katrin, I'll be on office in about an hour and will rearrange things for the patch to apply.
Created attachment 3844 [details] [review]
Consolidated, refactored patch
I checked out the html_template_pro tag for testing this with the old templates.
I tested in intranet:
Different biblionumbers and different views of biblio records:
Created attachment 3905 [details] [review]
Signed off: Consolidated, refactored patch [3.2.x]
Patches are only valid for 3.2, until they are reworked for Template::Toolkit
Created attachment 3938 [details] [review]
Consolidated, refactored patch [origin|tt]
Patch reworked for template::toolkit templates.
Chris N.: Note that patches for 3.2.x are already signed-off, but they where built against pre-tt origin, so they could need to be rebased to apply.
Pushed, please test
Works great in 3.4
This was included in the 3.4.0 release, marking closed