Some libraries want to be able to specify a hard limit on the number of items a record can have. It would be nice to have this set per record type, but since most libraries use item level itemtypes, that would make it confusing and non-intuitive. The simplest and most straight forward approach would just be to have a system preference. Koha should then just report that it failed to create an item if the librarian has hit the upper limit specified in the system preference.
Bit puzzled about this one - do you know what the use case is?
(In reply to Katrin Fischer from comment #1) > Bit puzzled about this one - do you know what the use case is? Because Zebra is size-bound, this will help libraries control the number of items on a record. In general there is a threshold where more items will make the record no longer show in zebra search results because it is too large.
Hm, as the problem also depends on the record size, maybe we could check this dynamically? Every number of items set to a max seems like mostly guessing/luck.
(In reply to Katrin Fischer from comment #3) > Hm, as the problem also depends on the record size, maybe we could check > this dynamically? Every number of items set to a max seems like mostly > guessing/luck. Indeed it is an educated guess, but with much lower overhead. I think checking record sizes would overly-complicate the libraries request. They have a good understanding of the size of their items and how many they can put on a record before it will no longer be indexed by zebra.
Created attachment 75018 [details] [review] Bug 17378: Add ability to specify maximum number of items per record Some libraries want to be able to specify a hard limit on the number of items a record can have. It would be nice to have this set per record type, but since most libraries use item level itemtypes, that would make it confusing and non-intuitive. The simplest and most straight forward approach would just be to have a system preference. Koha should then just report that it failed to create an item if the librarian has hit the upper limit specified in the system preference. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Set the new syspref RecordItemLimit to 3 4) Find a record with 4 or more records 5) Note in the catalog toolbar you cannot choose the add new item option 6) Note in the items editor you can edit items but not add new ones
The sandbox you've requested is not ready. Some problems occurred applying patches from bug 17378: <h1>Something went wrong !</h1>Applying: Bug 17378: Add ability to specify maximum number of items per record .git/rebase-apply/patch:159: trailing whitespace. warning: 1 line adds whitespace errors. .git/rebase-apply/patch:159: trailing whitespace. w arning: 1 line adds whitespace errors. e rror: F ailed to merge in the changes. Using index info to reconstruct a base tree... M installer/data/mysql/sysprefs.sql M koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc M koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt M koha-tmpl/intranet-tmpl/prog/js/catalog.js Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/js/catalog.js Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc Auto-merging installer/data/mysql/sysprefs.sql Patch failed at 0001 Bug 17378: Add ability to specify maximum number of items per record The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. Bug 17378 - Add ability to specify maximum number of items per record 75018 - Bug 17378: Add ability to specify maximum number of items per record Apply? [(y)es, (n)o, (i)nteractive] Patch left in /tmp/Bug-17378-Add-ability-to-specify-maximum-number-of-9CbVVm.patch .
Created attachment 81279 [details] [review] Bug 17378: Add ability to specify maximum number of items per record Some libraries want to be able to specify a hard limit on the number of items a record can have. It would be nice to have this set per record type, but since most libraries use item level itemtypes, that would make it confusing and non-intuitive. The simplest and most straight forward approach would just be to have a system preference. Koha should then just report that it failed to create an item if the librarian has hit the upper limit specified in the system preference. Test Plan: 1) Apply this patch 2) Run updatedatabase.pl 3) Set the new syspref RecordItemLimit to 3 4) Find a record with 4 or more records 5) Note in the catalog toolbar you cannot choose the add new item option 6) Note in the items editor you can edit items but not add new ones
It seems a little strange that if the threshold is 3 that 4 items can be attached... I started with a record that had two items, attached a third and expected to get the message at that point that I couldn't add a fourth, but I proceeded to add a fourth and then got the message I couldn't add a fifth. I think if the threshold is 3 that only 3 items should be able to be attached. --cori lynn
It also won't allow you to add 4 items as duplicates, so the functionality is inconsistent.