Bug 41808 - Don't trigger value builder plugins in batch item modification
Summary: Don't trigger value builder plugins in batch item modification
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-10 13:54 UTC by Philip Orr
Modified: 2026-02-11 13:12 UTC (History)
3 users (show)

See Also:
GIT URL:
Initiative type: ---
Sponsorship status: ---
Comma delimited list of Sponsors:
Crowdfunding goal: 0
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Orr 2026-02-10 13:54:08 UTC
Value builder plugins such as e.g. stocknumberam123.pl can be triggered while in batch item modification. This is a problem because it will cause the batch of items to take the new value, overwriting previously saved values in the items.
We should try to not trigger value builder plugins while in batch item modification, only in normal item modification / item creation.

To reproduce:
1. Find an example biblio and note which framework it was catalogued in (Edit -> Edit Record -> Check which framework is selected in the "Settings" dropdown at the top of the editing page)
2. Go to Administration -> MARC bibliographic framework -> on that framework, "Actions -> MARC Structure"
3. Find MARC fields 952$ -> "Actions -> Edit subfields"
4. Edit subfield 952$i
5. Select the value builder plugin stocknumberam123.pl
6. save
7. Go back to your example biblio, add an item, add a new stock number to field 952$i, save
8. Find barcodes of other items of biblios from your chosen framework and add them to a batch item modification
9. in the batch item modification template, click into the "Inventory number" field and then click somewhere else - the field will be incremented. At this point, there is no way to stop the field from incrementing. Even if you delete the value from the field, if you save the modification, it will still save the incremented value for all items in the batch.
Comment 1 Philip Orr 2026-02-11 10:29:32 UTC
After testing on ktd, apparently this was fixed at some point.
The script to increment the inventory number is no longer loaded in batch modification, only in item entry.
Closing the bug as it's no longer applicable.
Comment 2 Jan Kissig 2026-02-11 13:12:52 UTC
In Bug 28445 a no_plugin flag is introduced to prevent value builder plugins being loaded in batchMod.pl batchMod-edit.tt because they won't work as jquery is loaded at the end of the page. 
If that's being changed somehow, this bug will arise again.