Bug 41153

Summary: (Follow-up of 40559) Cleanup catalogue/MARCdetail.pl
Product: Koha Reporter: Marcel de Rooy <m.de.rooy>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: Passed QA --- QA Contact: Marcel de Rooy <m.de.rooy>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
GIT URL: Initiative type: ---
Sponsorship status: --- Crowdfunding goal: 0
Patch complexity: Trivial patch Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:
Bug Depends on: 40559    
Bug Blocks:    
Attachments: Bug 41153: Clean up catalogue/MARCdetail.pl
Bug 41153: Clean up catalogue/MARCdetail.pl

Description Marcel de Rooy 2025-10-31 08:49:17 UTC
See bug 40559. Moving second patch here.
Comment 1 Marcel de Rooy 2025-10-31 08:51:52 UTC
Created attachment 188767 [details] [review]
Bug 41153: Clean up catalogue/MARCdetail.pl
Comment 2 Marcel de Rooy 2025-10-31 08:55:33 UTC
Copying this here too:

> (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;
Comment 3 Marcel de Rooy 2025-10-31 10:13:39 UTC
(In reply to Marcel de Rooy from comment #2)
> Copying this here too:
> 
> > (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;

Still not sure if I understand this question. But here if is a "statement modifier". What follows is handled as an EXPR. So ( $x // '' ) ne $t seems to be a valid expression.
Please clarify if you still mean something else..
Comment 4 Marcel de Rooy 2025-10-31 10:15:47 UTC
Created attachment 188797 [details] [review]
Bug 41153: Clean up catalogue/MARCdetail.pl

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 5 Marcel de Rooy 2025-10-31 10:16:34 UTC
Combining SO and QA. This looks more exciting than it is :)