[Koha-bugs] [Bug 20623] PDF export of a basket group fails when an item has an itemtype that is not in the itemtype table

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Apr 20 11:27:34 CEST 2018


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20623

--- Comment #1 from Victor Grousset/tuxayo <victor.grousset at biblibre.com> ---
Created attachment 74604
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=74604&action=edit
Bug 20623 : Fix basket group PDF when itemtype not itemtype table

When an item has an itemtype not in the itemtype table. Trying to fetch
it's description lead to an error.
Using authorized values like ccode to populate the itemtypes of the
biblioitems (instead of the itemtype table) can lead to such data.
Or importing records with invalid itemtype codes. Koha doesn't do enough
checks at import to at least warn about these issues.

== Test plan ==
1. have/create a budget
2. have/create a fund
3. have/create a vendor with minimal info
4. create a basket with minimal info
5. add a item to the basket
6. go to the basket. URL should be
   /cgi-bin/koha/acqui/basket.pl?basketno=XXXXX
7. close this basket
8. create a basket group with the basket
   - your vendor page => Basket groups
   - create basket group
   - (tick the "close this basket group" check box)
9. go to the basket group
      your vendor page => Basket groups => Closed
10. export as PDF, it should work, keep the page opened
11. find the itemtype code of item in the basket
12. delete it with the following SQL[1] (directly or use sql reports)
      replace with the relevant type code
      DELETE from itemtypes where itemtype = "BOOK";
13. reexport the basket as PDF
14. it should fail (internal server error)
      this is the bug (no kidding ^^)
15. apply this patch
16. reexport the basket as PDF
17. it should work
18. create an item type (in administration)
      that has the same code as the deleted one
19. reexport the basket as PDF
20. check that in the PDF that the description is here:
      table at the bottom of the document → "Document" column

[1] Or you can find a more realistic way to have a biblioitem whose itemtype is
not in the itemtype table

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list