We should test for remains of bug 20461. Which will cause that more items (serial issues) will be created with an itype to NULL See the following for more details about the issue https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20461#c13
Isn't this covered by bug 21591 / bug 21150 ?
This issue is one of the causes of having invalid itype on items. So it would help having directly the root cause. We use a check for that: https://git.biblibre.com/biblibre/tools/src/commit/da516fdcd8a367047e1a5e5bdff9f9449f45b6eb/koha/db_check_itype.sh#L34 The important par is this one: if [[ "$itype_on_item" ]] && # the syspref [[ "$makePreviousSerialAvailable" ]] && # another syspref [[ "$invalid_itemtypes_exists" || # subscription.itemtype "$invalid_previousitemtypes_exists" ]] # subscription.previousitemtype
Maybe checking for subscription.itemtype isn't need. I haven't tested if the MARC frameworks usually doesn't let invalid values slip by.