Bug 41477

Summary: Show barcode of item in the action logs
Product: Koha Reporter: Nick Clemens (kidclamp) <nick>
Component: ToolsAssignee: Nick Clemens (kidclamp) <nick>
Status: Failed QA --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: roman.dolny
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Comma delimited list of Sponsors:
Crowdfunding goal: 0 Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Bug 41477: Handle deleted items
Bug 41477: Display barcode for items in cataloguing action logs
Bug 41477: Handle deleted items

Description Nick Clemens (kidclamp) 2025-12-18 13:13:59 UTC
Currently when displaying an item in the log viewer for 'cataloguing' modifications we display text/link like:

Item 972 from Bibliographic record 438

Librarians tend to use the barcode as the unique ID of the record, and we should display this info so they can more easily identify the items.
Comment 1 Nick Clemens (kidclamp) 2025-12-18 13:26:39 UTC
Created attachment 190621 [details] [review]
Bug 41477: Handle deleted items

We have a variable 'object_found' - without this we assume the item has been deleted

To test:
1 - Delete one of the items you modified, note the itemnumber
2 - Click the 'Modification log' tab - you don't see this item
3 - Search using the itemnumber in 'Object' field
4 - You have empty barcode field and broken links
5 - Apply this patch
6 - Reload
7 - You see the itemnumber and a note that it has been deleted
Comment 2 Roman Dolny 2025-12-19 19:12:36 UTC
kohadev-koha@kohadevbox:koha(bug_41477)$ git bz apply 41477

Bug 41477 - Show barcode of item in the action logs

190621 - Bug 41477: Handle deleted items

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 41477: Handle deleted items
error: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt).
error: could not build fake ancestor
Patch failed at 0001 Bug 41477: Handle deleted items
Comment 3 Nick Clemens (kidclamp) 2025-12-22 13:57:59 UTC
Created attachment 190667 [details] [review]
Bug 41477: Display barcode for items in cataloguing action logs

This patch displays the barcode, already passed to the template, when
viewing modification logs for items.

To test:
 1 - Find a biblio
 2 - Add or edit some items on the biblio
 3 - Edit them again to ensure we have some data
 4 - Click 'Modification log' tab on the left in biblio view
 5 - See items are displayed only by itemnumber
 6 - Apply patch
 7 - Reload
 8 - Now you see the current barcode for the item
 9 - Use itemnumber of one of the items as the 'Object' and search
10 - Verify you still see barcode info
Comment 4 Nick Clemens (kidclamp) 2025-12-22 13:58:01 UTC
Created attachment 190668 [details] [review]
Bug 41477: Handle deleted items

We have a variable 'object_found' - without this we assume the item has been deleted

To test:
1 - Delete one of the items you modified, note the itemnumber
2 - Click the 'Modification log' tab - you don't see this item
3 - Search using the itemnumber in 'Object' field
4 - You have empty barcode field and broken links
5 - Apply this patch
6 - Reload
7 - You see the itemnumber and a note that it has been deleted
Comment 5 Roman Dolny 2025-12-22 19:02:12 UTC
QA unhappy - log below.

Space character needed twice, before "<span":
line 283: Barcode:<span
line 293: Itemnumber:<span


kohadev-koha@kohadevbox:koha(bug_41477)$ qa
Tag v25.05.00-1 found in /kohadevbox/koha — checking out branch main in /kohadevbox/qa-test-tools
Already on 'main'
Your branch is up to date with 'origin/main'.
testing 2 commit(s) (applied to 7776239 '6c Bug 41432: Prefetch items and borr')

Processing files
[RUNNING] koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt

[error] ID0H0orrxh.tt: SyntaxError: Void elements do not have end tags "br" (2:93)
[error]   1 |
[error] > 2 |                                                 Barcode:<span class="barcode">#~189~#</span></br>
[error]     |                                                                                             ^^^^^
[error]   3 |                                                 <a
[error]   4 |                                                     href="/cgi-bin/koha/catalogue/moredetail.pl?item=#~190~#&amp;biblionumber=#~191~#&amp;bi=#~192~##item#~193~#"
[FAIL] koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt

Result:
[FAIL] koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt
   FAIL   filters
                missing_filter at line 293 (                                                Itemnumber:<span class="itemnumber">[% loopro.object %]</span></br>)
   FAIL   tidiness
                File is not tidy, please run `perl misc/devel/tidy.pl koha-tmpl/intranet-tmpl/prog/en/modules/tools/viewlog.tt`

Processing additional checks PASS!