Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FOLIO: Limit request pickupLocation options by item location #3876

Conversation

maccabeelevine
Copy link
Member

@maccabeelevine maccabeelevine commented Aug 22, 2024

FOLIO defines a relationship between each service point and the specific item locations that it is meant to service. When a patron places a hold for an item, we would like them to have to pick it up at the nearest service location -- not ship it to another library.

@maccabeelevine maccabeelevine marked this pull request as ready for review August 22, 2024 18:41
Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @maccabeelevine, a few initial thoughts based on an admittedly-cursory quick review. :-)

config/vufind/Folio.ini Outdated Show resolved Hide resolved
module/VuFind/src/VuFind/ILS/Driver/Folio.php Show resolved Hide resolved
module/VuFind/src/VuFind/ILS/Driver/Folio.php Outdated Show resolved Hide resolved
@dybarber
Copy link

Thanks @maccabeelevine. We've done some testing on this, but with the caveat that it was in v9.1. In our system, we have several service points available for pickup, and title-level holds enabled, so were able to test different scenarios pretty thoroughly. Everything worked as described - item requests were restricted to pickup from the item's effective location, and title-level requests allowed any pickup location. However, we can't imagine a scenario where a library would want to use this functionality in combination with title-level requests. We also have slightly more complicated needs within our library, and would want to be able to apply this to specific service points (most locations in our system allow their items to be picked up anywhere, but one branch with specialised material does not).

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @dybarber, for the testing! Sounds like this could be approved and merged as-is as a first step, or we could wait for @maccabeelevine to add some more nuance, depending on what he thinks is best/feasible.

In the meantime, one small refactoring suggestion based on a deeper review of the code.

// so limiting by itemEffectiveLocation does not apply
&& $holdInfo['item_id'] ?? false
) {
$response = $this->makeRequest(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would make sense to create a protected getItemById() method to abstract this lookup, since we're now doing it in two different places.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, done.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactoring looks great -- one minor nitpick about comments. :-)

*
* @param string $itemId UUID
*
* @return stdClass The item
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stdClass doesn't have a use statement in this class, so you should either add one or put a backslash here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed!

@maccabeelevine
Copy link
Member Author

Thanks @dybarber ! Yes that's exactly what we hoped it would do -- and like you, I can't see how this might be relevant for title-level requests.

I think this is ready for merge.

Copy link
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @maccabeelevine! If there's sufficient interest in only applying the itemEffectiveLocation logic to specific locations, I see no reason why we couldn't address that as a follow-up (perhaps by adding more syntax to the limitPickupLocations setting), so I'm fine with merging this as a first step now.

@demiankatz demiankatz merged commit 042ca5d into vufind-org:dev Aug 29, 2024
7 checks passed
@demiankatz demiankatz added this to the 10.1 milestone Aug 29, 2024
LuomaJuha pushed a commit to LuomaJuha/NDL-VuFind2 that referenced this pull request Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants