Bug 33276 - Library limitations will cause data loss when editing locations in the subscription form
Summary: Library limitations will cause data loss when editing locations in the subscr...
Status: Failed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Serials (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Thibaud Guillot (thibaud_g)
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-20 13:06 UTC by Thibaud Guillot (thibaud_g)
Modified: 2023-03-30 12:28 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 33276: Get auth values for location on serials (1.44 KB, patch)
2023-03-20 13:19 UTC, Thibaud Guillot (thibaud_g)
Details | Diff | Splinter Review
Bug 33276: Get auth values for location on serials (1.50 KB, patch)
2023-03-30 08:44 UTC, Clemens Tubach
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Thibaud Guillot (thibaud_g) 2023-03-20 13:06:23 UTC
Hello @ll,

This bug can be related to 31422 and 32748. That's the same behavior on "Locations" dropdown list for serials.

When a value is limited to a library if we're logging with a patron from another lib, the location value is empty and can be replaced. 
I copied the same logic as the submitted patch for 32748. We can modify the value but the current value (provides from another lib) stay in dropdown.
Comment 1 Katrin Fischer 2023-03-20 13:15:19 UTC
Hi Thibaud, I think the item form in acquisitions is also based on the same code as the one in serials.
Comment 2 Thibaud Guillot (thibaud_g) 2023-03-20 13:19:13 UTC
Created attachment 148412 [details] [review]
Bug 33276: Get auth values for location on serials

Serial location is linked to a library, if we want to modify serial
with users does not belongs to, location is not in select and we could
erase it.

Test plan:

1) Be sure to have a LOC authorized value limited to one library at
least
2) See when editing serial subscription you didn't get the current
location
3) Apply this patch
4) Refresh and now you've got the value
Comment 3 Thibaud Guillot (thibaud_g) 2023-03-20 13:20:55 UTC
(In reply to Katrin Fischer from comment #1)
> Hi Thibaud, I think the item form in acquisitions is also based on the same
> code as the one in serials.

Hi Katrin, 

Hum.. I wrote a patch but it's not like in items, the form isn't generated on the same way.. or I miss up :/
Comment 4 Katrin Fischer 2023-03-20 16:52:32 UTC
(In reply to Thibaud Guillot from comment #3)
> (In reply to Katrin Fischer from comment #1)
> > Hi Thibaud, I think the item form in acquisitions is also based on the same
> > code as the one in serials.
> 
> Hi Katrin, 
> 
> Hum.. I wrote a patch but it's not like in items, the form isn't generated
> on the same way.. or I miss up :/

What I meant: 

The item forms in Koha are built with different code:

* Cataloguing / Item form
* Serial item form / Acquisition item form

But I misunderstood your patch: you are updating the location in the subscription form. That's also a great catch and I am very happy to see more and more of these issues fixed!

There is also an option to set the collection for the subscription now, I think we'll need the same fix there. What do you think?
Comment 5 Clemens Tubach 2023-03-30 08:44:22 UTC
Created attachment 148958 [details] [review]
Bug 33276: Get auth values for location on serials

Serial location is linked to a library, if we want to modify serial
with users does not belongs to, location is not in select and we could
erase it.

Test plan:

1) Be sure to have a LOC authorized value limited to one library at
least
2) See when editing serial subscription you didn't get the current
location
3) Apply this patch
4) Refresh and now you've got the value

Signed-off-by: Clemens Tubach <clemens.tubach@kit.edu>
Comment 6 Nick Clemens (kidclamp) 2023-03-30 12:28:14 UTC
This is missing the category parameter in the search - so it may pull a matching value form another category.

It looks like Jonathan added comments on 32748 that need to be addressed here as well. 

We should develop a centralized fix in GetAuthorisedValues, or move things to Koha namespace