Bug 19651 - SIP/ILS/Item missing title
Summary: SIP/ILS/Item missing title
Alias: None
Product: Koha
Classification: Unclassified
Component: SIP2 (show other bugs)
Version: master
Hardware: All All
: P5 - low critical (vote)
Assignee: Stefan Berndtsson
QA Contact: Marcel de Rooy
Depends on: 18276
  Show dependency treegraph
Reported: 2017-11-20 11:47 UTC by Stefan Berndtsson
Modified: 2017-12-11 08:04 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Bot Control: ---
When did the bot last check this:
Who signed the patch off:
Text to go in the release notes:

Add title and author from biblio to SIP/ILS/Item.pm (602 bytes, patch)
2017-11-23 12:10 UTC, Stefan Berndtsson
Details | Diff | Splinter Review
[PATCH] Bug 19651 - SIP/ILS/Item missing title (1.11 KB, patch)
2017-11-23 13:49 UTC, Benjamin Rokseth
Details | Diff | Splinter Review
Bug 19651: SIP/ILS/Item misses title and author (1.07 KB, patch)
2017-11-24 07:10 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Berndtsson 2017-11-20 11:47:46 UTC
In 17.05 of C4/SIP/ILS/Item.pm (sub new) $item is fetched via GetBiblioFromItemNumber(). I assume this means that "title" was available as a property on the $item object.

In master however, $item is fetched using Koha::Item->find() which means it is a pure Item object, and does not contain biblio data. $item->{title} is therefor lost.

The "title" property has to be reinserted from $biblio explicitly. Looking at the %fields hash in the same file, "author" is probably another field that needs fixing too.
Comment 1 Stefan Berndtsson 2017-11-23 12:10:48 UTC
Created attachment 69302 [details] [review]
Add title and author from biblio to SIP/ILS/Item.pm

Adding title and author manually lite this is a simple fix that solves the problem.
Comment 2 Benjamin Rokseth 2017-11-23 13:05:21 UTC
We Oslo Public Library can confirm this is an issue. 
Problem is that $item->unblessed overloads $self, and thus no $self->{author} or $self->{title} as was in GetBiblioFromItemnumber.

This solution is a workaround, probably needs rework, and tests, later. But since release 17.11 is so close, and it will break any Item information response and probably any self checkout device, I propose this be added as is.
Comment 3 Benjamin Rokseth 2017-11-23 13:49:21 UTC
Created attachment 69303 [details] [review]
[PATCH] Bug 19651 - SIP/ILS/Item missing title

Signed-off-by: Benjamin Rokseth <bensinober@gmail.com>
Comment 4 Benjamin Rokseth 2017-11-23 13:55:45 UTC
Took the liberty of adding git bz required info to your patch. It is needed for using git bz (https://wiki.koha-community.org/wiki/Git_bz_configuration) which Koha community uses for bugtracking.

Basically it is email version of git issues, very old and tedioius, but this is what is used.
Comment 5 Marcel de Rooy 2017-11-24 07:10:43 UTC
Created attachment 69327 [details] [review]
Bug 19651: SIP/ILS/Item misses title and author

Signed-off-by: Benjamin Rokseth <bensinober@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Amended $item->biblio by $biblio.
Comment 6 Jonathan Druart 2017-11-26 16:05:19 UTC
Caused by bug 18276.
Comment 7 Jonathan Druart 2017-11-26 16:26:25 UTC
Patch pushed to Master!
Thanks Stephan and congrats for your first patch in!
Comment 8 Fridolin SOMERS 2017-12-11 08:04:28 UTC
Bug 18276 not in 17.05.x