Main Koha release repository https://koha-community.org
Find a file
Marcel de Rooy 0fc3f19605 Bug 19004: Adjust AddReturn for retrieving item type
In the regular situation, you can get itemtype via biblio and then
biblioitem as well as via biblioitem (at least when item-level_itypes
is set to biblio).

But since Koha unfortunately defined two relations in item, one for
biblioitemnumber (the good one) and one for biblionumber (redundant),
TestBuilder (correctly) builds one biblioitem and two biblios.

If you item-level_itypes to biblio record, this will result in failing tests
when calling AddReturn (in this case Koha/Patrons.t).
It will crash on:
    Can't call method "itemtype" on an undefined value at C4/Circulation.pm line 1826.
Cause: AddReturn goes via the biblionumber to biblio and than to
biblioitems, and it does not find a biblioitem. (Not a fault from TestBuilder
but a database design problem.)

This patch makes a small change in AddReturn to retrieve the itemtype via
biblioitem. It actually is a shorter road than items->biblio->biblioitems.

Note: I do not test the Biblioitems->find call, since we already checked
the GetItem call before and we have a foreign key constraint.
I did not call $item->effective_itemtype since we still use GetItem; this
could be done later.

Adjusted Circulation/Returns.t too: If we add an item with TestBuilder and
we called AddBiblio before, we should link biblioitemnumber as well.

Test plan:
[1] Do not apply this patch yet.
[2] Set item-level_itypes to biblio record.
[3] Run t/db_dependent/Koha/Patrons.t. (It should fail.)
[4] Apply this patch.
[5] Run t/db_dependent/Koha/Patrons.t again.
[6] Run t/db_dependent/Circulation/Returns.t
[7] Git grep on AddReturn and run a few other tests calling it.
    Note: Bugs 19070/19071 address three tests that call AddReturn too.
[8] In the interface, check in a book.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Note: Bugs 19070 and 19071 are already pushed. The command in comment #4
      has all the tests successful.

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-09-01 13:02:27 -03:00
acqui Bug 19194: Check itemtype is defined when receiving an order 2017-09-01 10:45:36 -03:00
admin
api/v1
authorities
basket
C4 Bug 19004: Adjust AddReturn for retrieving item type 2017-09-01 13:02:27 -03:00
catalogue
cataloguing Bug 19040: Refactor GetMarcBiblio parameters 2017-08-25 10:23:42 -03:00
circ
clubs
course_reserves Bug 18367 - (QA Followup) Only warn if doing a lookup and not having an item 2017-07-28 11:37:06 -03:00
debian
docs Bug 7143: Add Patricio Marrone to history.txt 2017-03-31 13:45:33 +00:00
errors
etc Bug 18104 - allow SIP2 field AE (personal name ) to be customized 2017-07-06 14:52:54 -03:00
installer Bug 18718: DBRev 17.05.00.005 2017-09-01 12:59:58 -03:00
Koha Bug 9857 - Follow-up - Fix for searches with su= or su: 2017-09-01 13:02:24 -03:00
koha-tmpl Bug 14316: Clarify meaning of record number in Batch record modification tool 2017-09-01 13:02:26 -03:00
labels
members Bug 19129 - Clean up Details tab for Organisation patrons 2017-09-01 13:02:23 -03:00
misc Bug 17969: Refactor the way <<items.content>> is generated 2017-08-30 15:06:25 -03:00
offline_circ
opac Bug 18946 [QA Followup] - code cleanup 2017-09-01 13:02:26 -03:00
OpenILS
patron_lists
patroncards
plugins Bug 19088: plugins-upload causes error log noise 2017-08-30 15:05:56 -03:00
reports Bug 19061: [QA Follow-up] Wrong interpolation 2017-08-15 12:17:43 -03:00
reserve Bug 19056: Replace C4::Reserves::GetReserveCount with Koha::Patron->holds->count 2017-09-01 13:00:05 -03:00
reviews
rotating_collections
serials Bug 19130: (followup) Controller scripts should preserve behaviour 2017-08-25 11:53:44 -03:00
services
skel Bug 11078: Add locking to rebuild_zebra 2014-02-28 22:21:41 +00:00
sms
suggestion
svc Bug 19040: Refactor GetMarcBiblio parameters 2017-08-25 10:23:42 -03:00
t Bug 19004: Adjust AddReturn for retrieving item type 2017-09-01 13:02:27 -03:00
tags
test
tmp/modified_authorities
tools Bug 19080: Handle non-existing patrons gratefully 2017-08-25 11:03:37 -03:00
virtualshelves
xt
.editorconfig
.htaccess
.mailmap
about.pl
changelanguage.pl
edithelp.pl Bug 16447: Remove occurrence of the borrow permission which does no longer exist 2016-05-05 21:28:14 +00:00
fix-perl-path.PL
help.pl
INSTALL
install-CPAN.pl
Koha.pm Bug 18718: DBRev 17.05.00.005 2017-09-01 12:59:58 -03:00
koha_perl_deps.pl
kohaversion.pl
LICENSE
mainpage.pl
Makefile.PL
MANIFEST.SKIP
README
README.md
README.robots
rewrite-config.PL

Koha is a free software integrated library system (ILS).

Koha is distributed under the GNU GPL version 3 or later.

Note: This is a synced mirror of the official Koha repo.

Note: Koha does not accept pull requests from git hosting sites.

Note: This project has its own bug tracker, to report a bug or submit a patch visit http://bugs.koha-community.org.

For guidelines on submitting patches for Koha please visit https://wiki.koha-community.org/wiki/SubmitingAPatch

The developers handbook can be found at https://wiki.koha-community.org/wiki/Developer_handbook

http://koha-community.org/

Koha Logo