Bug 17420 - record export fails when itemtype on biblio

In Tools, Export data, you can export with a filter on item type.
When item type is on biblio record, you get the error :
export.pl: DBIx::Class::ResultSet::next(): Unknown column 'biblioitems.itemtype' in 'where clause' at /home/koha/src/Koha/Objects.pm line 150

Looks like its because this code use to be a SQL Select and is now a DBIx call :
                          C4::Context->preference('item-level_itypes')
                            ? ( 'items.itype' => $itemtype )
                            : ( 'me.itemtype' => $itemtype )

This patch corrects by using "me.itemtype"

Test plan :
- Use syspref item-level_itypes = biblio record
- Go to Tools > Export data : /cgi-bin/koha/tools/export.pl
- Select an item type
- Click on "Export biblio records"
=> Without patch you get an error 500
=> With patch you get a correct export file

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Fix the issue, no errors.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
This commit is contained in:
Fridolin Somers 2016-10-10 16:46:04 +02:00 committed by Julian Maurice
parent 9d0c7986f9
commit 4c943184db
1 changed files with 1 additions and 1 deletions

View File

@ -144,7 +144,7 @@ if ( $op eq "export" ) {
?
C4::Context->preference('item-level_itypes')
? ( 'items.itype' => $itemtype )
: ( 'biblioitems.itemtype' => $itemtype )
: ( 'me.itemtype' => $itemtype )
: ()
),