open-ils.actor.container.item.create does not work with more than 1 item

Bug #1594617 reported by Jason Stephenson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Evergreen
New
Undecided
Unassigned

Bug Description

Evergreen: 2.9, 2.10, and master
OpenSRF Version: N/A
Pg Version: N/A

The documentation and most of the code for open-ils.actor.container.item.create says it can accept an array ref of items in the item argument.

However, the permission checking code assumes that only 1 item is present. Thus, passing an array of items leads to a Perl error:

Can't call method "bucket" on unblessed reference at /usr/local/share/perl/5.18.2/OpenILS/Application/Actor/Container.pm line 314.

I used code like that in the attachment to trigger it. You would need to modify it for it to "work" in your environment.

I can think of a couple of ways to fix it.

1) Is to loop over all of the bucket items, checking the permission for each bucket, and returning as soon as there is a failure. This makes no assumptions about the items being in the same bucket.

2) Is to simply check the permissions on the bucket of the first item. This assumes that all the items are being added to the same bucket.

I'm inclined to go with #1, but I'll leave that open for discussion.

Tags: buckets-item
Revision history for this message
Jason Stephenson (jstephenson) wrote :
tags: added: buckets-item
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.