This is my console output: Uncaught TypeError: Cannot read properties of undefined (reading 'branchname') at render (members-home.pl:2483:76) at datatables.min_23.0500000.js:56:435 at b.fnGetData (datatables.min_23.0500000.js:50:221) at B (datatables.min_23.0500000.js:55:141) at Ha (datatables.min_23.0500000.js:63:1) at P (datatables.min_23.0500000.js:67:433) at vb (datatables.min_23.0500000.js:78:98) at datatables.min_23.0500000.js:75:167 at i (datatables.min_23.0500000.js:73:338) at Object.success (datatables.min_23.0500000.js:74:40) And this is where branchname appears in members-home.pl: in { "data": "library_id", "searchable": true, "orderable": true, "render": function( data, type, row, meta ) { let library_name = libraries_map[data].branchname if( !singleBranchMode && data == logged_in_library_id ) { return "<span class=\"currentlibrary\">" + escape_str(library_name) + "</span>"; } else { return escape_str(library_name); } } } It seems that this bug may be related: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=31421 Though it says a fix was pushed to stable.
How can I reproduce this?
I think there is a confusion in Koha::Libraries->search_filtered, and we don't add the logged in library.
Created attachment 153051 [details] [review] Bug 34145: Allow access the logged in branch's limited data
Justin, could you confirm this patch fixes your problem?
Nick, does this patch seem correct to you?
The name is a killer :) sub libraries_where_can_see_things
(In reply to Jonathan Druart from comment #5) > Nick, does this patch seem correct to you? I don't recreate, what is the setup? Also, without view_borrower_infos_from_any_libraries you can log into another branch, but still can't see their patrons, so I don't think we should be adding the logged in branch. Can you explain why we should?
Can we get some non-code summary on what happens here and a test plan?
I didn't recreate, the patch was just a guess. See also bug 34147.
At the moment it looks like we have no information on how to make this bug appear. I have tested the patron search a lot for various bugs and couldn't detect an issue or this bug. I am downgrading this one. Please provide more information! * What is the exact version you are seeing this in * What is your setup? (IndependentBranches? Library groups?)
I am not sure how useful this is but I found an instance where this can be recreated. If the branchcode on the borrowers table is in an different case to the branchcode on the branches table this problem can occur. MySQL doesn't care about case sensitivity but when javascript gets a hold of it branchcode != BRANCHCODE. Updating the borrowers table (or branches table) to make all the same case (upper or lower) resolved the issue. 23.11