Bug 5791 - Robust handling of deleted biblios/authorities
Summary: Robust handling of deleted biblios/authorities
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: PATCH-Sent (DO NOT USE) normal (vote)
Assignee: Tomás Cohen Arazi
QA Contact: Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-22 13:07 UTC by Tomás Cohen Arazi
Modified: 2013-02-28 15:02 UTC (History)
3 users (show)

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


Attachments
Initial patch (14.27 KB, patch)
2011-02-22 19:50 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
(1/2) follow-up - owen suggestions for text (5.11 KB, patch)
2011-03-09 12:43 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
(2/2) Error handling for ISBDdetail, MARCdetail and labeledMARCdetail (9.81 KB, patch)
2011-03-09 13:22 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Consolidated, refactored patch (22.39 KB, patch)
2011-04-08 16:40 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Signed off: Consolidated, refactored patch [3.2.x] (22.44 KB, patch)
2011-04-12 21:42 UTC, Katrin Fischer
Details | Diff | Splinter Review
Consolidated, refactored patch [origin|tt] (18.43 KB, patch)
2011-04-18 12:42 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Tomás Cohen Arazi 2011-02-22 13:07:45 UTC
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:

Software 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.
Comment 1 Tomás Cohen Arazi 2011-02-22 19:50:07 UTC
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.
Comment 2 Tomás Cohen Arazi 2011-02-22 19:50:45 UTC Comment hidden (obsolete)
Comment 3 MJ Ray (software.coop) 2011-03-04 10:26:55 UTC
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
Comment 4 Owen Leonard 2011-03-04 14:55:55 UTC
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
Comment 5 Tomás Cohen Arazi 2011-03-09 12:43:36 UTC Comment hidden (obsolete)
Comment 6 Tomás Cohen Arazi 2011-03-09 13:22:28 UTC Comment hidden (obsolete)
Comment 7 MJ Ray (software.coop) 2011-04-03 23:22:32 UTC
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
Comment 8 Katrin Fischer 2011-04-08 08:16:49 UTC
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...
Auto-merging authorities/detail.pl
CONFLICT (content): Merge conflict in authorities/detail.pl
Auto-merging catalogue/detail.pl
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tmpl
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
Comment 9 Tomás Cohen Arazi 2011-04-08 10:54:57 UTC
Katrin, I'll be on office in about an hour and will rearrange things for the patch to apply.
Comment 10 Tomás Cohen Arazi 2011-04-08 16:40:08 UTC Comment hidden (obsolete)
Comment 12 Katrin Fischer 2011-04-12 21:42:31 UTC
Created attachment 3905 [details] [review]
Signed off: Consolidated, refactored patch [3.2.x]
Comment 13 Chris Cormack 2011-04-12 23:07:57 UTC
Patches are only valid for 3.2, until they are reworked for Template::Toolkit
Comment 14 Tomás Cohen Arazi 2011-04-18 12:42:00 UTC
Created attachment 3938 [details] [review]
Consolidated, refactored patch [origin|tt]

Patch reworked for template::toolkit templates.
Comment 15 Tomás Cohen Arazi 2011-04-18 12:44:03 UTC
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.
Comment 16 Chris Cormack 2011-04-20 00:05:41 UTC
Pushed, please test
Comment 17 Katrin Fischer 2011-04-25 16:35:22 UTC
Works great in 3.4
Comment 18 Chris Cormack 2011-04-27 04:42:29 UTC
This was included in the 3.4.0 release, marking closed