Bug 40559 - Fix a noisy warn in catalogue/MARCdetail
Summary: Fix a noisy warn in catalogue/MARCdetail
Status: BLOCKED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Marcel de Rooy
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-07-31 07:54 UTC by Marcel de Rooy
Modified: 2025-09-19 08:05 UTC (History)
2 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:
Circulation function:


Attachments
Bug 40559: Fix noisy warning in MARCdetail (1.77 KB, patch)
2025-07-31 09:02 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 40559: cleanup (3.20 KB, patch)
2025-09-15 14:31 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Marcel de Rooy 2025-07-31 07:54:05 UTC
Actually a long standing fix already..
Comment 1 Marcel de Rooy 2025-07-31 09:02:40 UTC
Created attachment 184919 [details] [review]
Bug 40559: Fix noisy warning in MARCdetail

Rebased for 25.06.
Resolves:
    [2025/07/31 10:59:02] [WARN] Use of uninitialized value in string eq at /usr/share/koha/catalogue/MARCdetail.pl line 203.

Test plan:
Check if warn disappears with this patch.
Trigger the warn by opening catalogue/MARCdetail on staff view. (Should
be enough with a normal MARC record.)

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 2 Marcel de Rooy 2025-07-31 09:03:20 UTC
Trivial. Self SO
Comment 3 Jonathan Druart 2025-09-15 14:31:15 UTC
Created attachment 186407 [details] [review]
Bug 40559: cleanup
Comment 4 Jonathan Druart 2025-09-15 14:31:25 UTC
Would you accept this follow-up?
Comment 5 Jonathan Druart 2025-09-15 14:32:10 UTC
Also wondering....

                 next
                    if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{tab} // q{} ) ne
                     $tabloop;    # Note: defaulting to '0' changes behavior!

Why?
Comment 6 Marcel de Rooy 2025-09-16 11:13:29 UTC
Will check
Comment 7 Marcel de Rooy 2025-09-17 14:11:34 UTC
(In reply to Jonathan Druart from comment #4)
> Would you accept this follow-up?

I feel that we should move it on its own report. The noisy warning patch is just about 1 line of code (-1,+3) and can be backported.
The cleanup could go on its own and would be an enhancement, right?
Comment 8 Marcel de Rooy 2025-09-17 14:24:24 UTC
(In reply to Jonathan Druart from comment #5)
> Also wondering....
> 
>                  next
>                     if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0]
> }->{tab} // q{} ) ne
>                      $tabloop;    # Note: defaulting to '0' changes behavior!
> 
> Why?

Since tabloop can be zero? Or do you mean something else?
Comment 9 Jonathan Druart 2025-09-19 08:05:05 UTC
(In reply to Marcel de Rooy from comment #8)
> (In reply to Jonathan Druart from comment #5)
> > Also wondering....
> > 
> >                  next
> >                     if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0]
> > }->{tab} // q{} ) ne
> >                      $tabloop;    # Note: defaulting to '0' changes behavior!
> > 
> > Why?
> 
> Since tabloop can be zero? Or do you mean something else?

The if syntax:
  next if ( $var ) ne $tabloop;