NatLibFi / koha-plugin-rest-di

REST API plugin for Koha to provide additional functionality for discovery interfaces such as VuFind
GNU General Public License v3.0
9 stars 9 forks source link

Hold availability is true when it should be false #24

Closed minusdavid closed 11 months ago

minusdavid commented 1 year ago

The scenario is that I've already placed an item level hold on Item A for Record A.

The API response for the "hold" endpoint says that holds are available at the record level and the item level, but if you go into the Koha OPAC, it'll say the following:

At the record level: "You already have at least one item level hold on this title. All further holds must be item level."

At the item level: "This title cannot be requested because you already have hold for this item."

minusdavid commented 1 year ago

When a hold is attempted against Koha's core APIs, it'll say "Hold cannot be placed. Reason: itemAlreadyOnHold".

minusdavid commented 1 year ago

I haven't looked at the Koha code, but I wonder if this is one of those situations where the logic is embedded in the View rather than the Model.

EreMaijala commented 1 year ago

Thanks for the report, I'll check this out as soon as possible. The usual issue is that there is (or was when the plugin code was created) no performant way of checking this in the core code so the plugin does its own checks but is missing a bit.

minusdavid commented 1 year ago

As you said the other day, holds seem simple on the surface, but they're so complicated once you really start getting into the guts of them... 😬

minusdavid commented 1 year ago

Hmm I'm also seeing it say "available" even when there's too many holds for the record...