Bug 39029 - When a basket contains an order transferred from another basket some info is incorrect
Summary: When a basket contains an order transferred from another basket some info is ...
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Acquisitions (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Imani
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-04 17:40 UTC by Nick Clemens (kidclamp)
Modified: 2025-03-06 19:19 UTC (History)
3 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 39029: When a basket contains an order transferred from another basket some info is incorrect. (2.58 KB, patch)
2025-02-12 21:34 UTC, Imani
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Clemens (kidclamp) 2025-02-04 17:40:10 UTC
When a basket has orders transferred from another basket we do this:
                                                            [% IF (books_loo.transferred_from) %]
                                                                [% basket = books_loo.transferred_from.basket %]
                                                                [% bookseller = books_loo.transferred_from.bookseller %]
                                                                [% timestamp = books_loo.transferred_from.timestamp %]


But later when building the 'Add to basket' modal - we have this:
                                    <div id="addtoBasket" class="modal" tabindex="-1" role="dialog" aria-labelledby="addtoBasketLabel" aria-hidden="true" data-basketno="[% basket.basketname | html %]">

We are using the wrong basket now to pull info
Comment 1 Nick Clemens (kidclamp) 2025-02-04 17:41:52 UTC
To recreate:
1 - Create a new basket - 'Gonna transfer'
2 - Add an order to the basket
3 - Create another basket 'Has the transfer'
4 - Return to first basket and transfer order to second
5 - Return to second basket, click 'Add to basket' and inspect the modal
6 - Note basketno says 'Gonna transfer'

It should have correct name, and maybe be renamed to 'basketname'
Comment 2 Imani 2025-02-12 21:02:45 UTC
I have changes for this but am running into some errors trying to attach my patch.

Traceback (most recent call last):
  File "/usr/bin/git-bz", line 2845, in <module>
    do_attach(*args)
  File "/usr/bin/git-bz", line 2171, in do_attach
    add_url(bug, commits)
  File "/usr/bin/git-bz", line 1719, in add_url
    add_url_to_head_commit(commit, bug)
  File "/usr/bin/git-bz", line 1682, in add_url_to_head_commit
    git.commit(file="-", amend=True, _input=input)
  File "/usr/bin/git-bz", line 197, in f
    o = git_run(command, *args, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/bin/git-bz", line 167, in git_run
    output, error = process.communicate(input)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1207, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 2039, in _communicate
    input_view = memoryview(self._input)
                 ^^^^^^^^^^^^^^^^^^^^^^^


I tried doing a fresh ktd pull but still the same error.
Comment 3 Imani 2025-02-12 21:34:29 UTC
Created attachment 177978 [details] [review]
Bug 39029: When a basket contains an order transferred from another basket some info is incorrect.

To test:
1 - Create a new basket - 'Gonna transfer'
2 - Add an order to the basket
3 - Create another basket 'Has the transfer'
4 - Return to first basket and transfer order to second
5 - Return to second basket, click 'Add to basket' and inspect the modal
6 - Note basketno says 'Gonna transfer'
7 - apply the patch
8 - redo steps 1 through 6 with fresh baskets and the modal should have the correct values