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 : export.pl: DBIx::Class::ResultSet::next(): Unknown column 'biblioitems.itemtype' in 'where clause' at /home/koha/src/Koha/Objects.pm line 150
Created attachment 56117 [details] [review] 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 empty file and error 500 in logs => With patch you get a correct export file
Created attachment 56118 [details] [review] 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
Confirmed by Kyle, Now with Koha::Object, writing a condition on the object itself must be called with "me.xxxx".
Patch tested with a sandbox, by Séverine <severine.queune@bulac.fr>
You should also propose the same change for the misc/export_records.pl script.
Created attachment 57269 [details] [review] Bug 17420 - record export fails when itemtype on biblio - followup Same as previous patch for misc/export_records.pl. Test plan : - Use syspref item-level_itypes = biblio record - Run misc/export_records.pl => Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ... => With patch you get a correct export file
(In reply to Jonathan Druart from comment #5) > You should also propose the same change for the misc/export_records.pl > script. Indeed, I had not seen it
Created attachment 57405 [details] [review] [SIGNED-OFF] 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.
Created attachment 57406 [details] [review] [SIGNED-OFF] Bug 17420 - record export fails when itemtype on biblio - followup Same as previous patch for misc/export_records.pl. Test plan : - Use syspref item-level_itypes = biblio record - Run misc/export_records.pl => Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ... => With patch you get a correct export file Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Export Ok, no errors.
Created attachment 57442 [details] [review] 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>
Created attachment 57443 [details] [review] Bug 17420 - record export fails when itemtype on biblio - followup Same as previous patch for misc/export_records.pl. Test plan : - Use syspref item-level_itypes = biblio record - Run misc/export_records.pl => Without patch you get an error : DBD::mysql::st execute failed: Unknown column 'biblioitems.itemtype' in 'where clause' ... => With patch you get a correct export file Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com> Export Ok, no errors. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Pushed to master for 16.11, thanks Frido!
Pushed to 3.22.x, will be in 3.22.13
Pushed to 16.05.x, for 16.05.06 release