Bug 40544 - Manage bundle button broken
Summary: Manage bundle button broken
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low major
Assignee: Jonathan Druart
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on: 40127
Blocks:
  Show dependency treegraph
 
Reported: 2025-07-29 17:04 UTC by Caroline Cyr La Rose
Modified: 2025-08-05 15:51 UTC (History)
4 users (show)

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


Attachments
Bug 40544: Move some bundles related code out of document.ready (36.60 KB, patch)
2025-07-30 08:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40544: Move some bundles related code out of document.ready (36.65 KB, patch)
2025-07-30 08:56 UTC, David Nind
Details | Diff | Splinter Review
Bug 40544: Move some bundles related code out of document.ready (36.72 KB, patch)
2025-07-30 13:32 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 40544: Move some bundles related code out of document.ready (36.81 KB, patch)
2025-08-01 07:44 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2025-07-29 17:04:45 UTC
The "Manage bundle" button doesn't work on my KTD. When I click it, it doesn't do anything and there are errors in the console.

To recreate :
1. Find a record with items
2. Click Edit > Edit record
3. Change the 7th position of the leader to "c"
   OR 
   - Click the Tag editor for the leader
   - Choose "c-Collection" under "7- Bibliographic level"
   - Click "Save"
   (If necessary, fill out any other missing mandatory fields, like 040$c)
4. Click "Save"
5. Click "Manage bundles (0|0)" next to one of the items
   --> Nothing happens
   --> Error in the console "Uncaught ReferenceError: createChild is not defined"
   --> Normal behaviour : it should open a tab (?) to add records to the bundle

A bisect pointed to bug 40127 as the possible source of the error...
Comment 1 Caroline Cyr La Rose 2025-07-29 17:05:38 UTC
I put the level at major because the is a functionality that is broken.
Comment 2 David Nind 2025-07-29 19:16:30 UTC
Can confirm that this is happening in main and 25.05.x.
Comment 3 Caroline Cyr La Rose 2025-07-29 19:32:43 UTC
(In reply to David Nind from comment #2)
> Can confirm that this is happening in main and 25.05.x.

Thanks for confirming David! It felt impossible that this has been going on for a month and there wasn't any bug report about it... I was sure I was doing something wrong.
Comment 4 David Nind 2025-07-29 20:09:47 UTC
Can also confirm that it doesn't work in 24.11.x (tested in 24.11.07).

The button works in a 24.05.x site.
Comment 5 Caroline Cyr La Rose 2025-07-29 20:30:59 UTC
(In reply to David Nind from comment #4)
> Can also confirm that it doesn't work in 24.11.x (tested in 24.11.07).
> 
> The button works in a 24.05.x site.

Ok so it means the link to bug 40127 isn't justified, as it was added to 24.11.08.
Comment 6 Caroline Cyr La Rose 2025-07-29 20:54:46 UTC
I was actually trying to test/document bug 29560 when I found this. The error might come from there, createChild from the error in the console seems like it could refer to that...
Comment 7 Jonathan Druart 2025-07-30 08:15:03 UTC
Created attachment 184858 [details] [review]
Bug 40544: Move some bundles related code out of document.ready

On bug 40127 we moved the build_items_table calls outside of document
ready, but createChild is defined in document.ready (and so defined too
late).

This patches fix the following JS error:
"Uncaught ReferenceError: createChild is not defined"
Comment 8 David Nind 2025-07-30 08:56:50 UTC
Created attachment 184860 [details] [review]
Bug 40544: Move some bundles related code out of document.ready

On bug 40127 we moved the build_items_table calls outside of document
ready, but createChild is defined in document.ready (and so defined too
late).

This patches fix the following JS error:
"Uncaught ReferenceError: createChild is not defined"

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 Caroline Cyr La Rose 2025-07-30 13:32:14 UTC
Created attachment 184891 [details] [review]
Bug 40544: Move some bundles related code out of document.ready

On bug 40127 we moved the build_items_table calls outside of document
ready, but createChild is defined in document.ready (and so defined too
late).

This patches fix the following JS error:
"Uncaught ReferenceError: createChild is not defined"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>
Comment 10 Caroline Cyr La Rose 2025-07-30 13:33:13 UTC
Thank you Jonathan and David! It was already signed off, but I added mine as a thank you anyway :)
Comment 11 Marcel de Rooy 2025-08-01 07:44:15 UTC
Created attachment 184972 [details] [review]
Bug 40544: Move some bundles related code out of document.ready

On bug 40127 we moved the build_items_table calls outside of document
ready, but createChild is defined in document.ready (and so defined too
late).

This patches fix the following JS error:
"Uncaught ReferenceError: createChild is not defined"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Caroline Cyr La Rose <caroline.cyr-la-rose@inlibro.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 12 Lucas Gass (lukeg) 2025-08-01 19:25:29 UTC
Nice work everyone!

Pushed to main for 25.11