Bug 20304

Summary: Warnings in cataloguing scripts need to be removed
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: julian.maurice, martin.renvoize, mtompset
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 19996    
Bug Blocks:    
Attachments: Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: Remove warnings from cataloguing scripts
Bug 20304: (QA follow-up) Remove unwanted 'my'

Description Jonathan Druart 2018-02-27 16:35:11 UTC
Since bug 19996 we have now warnings in cataloguing scripts.
Comment 1 Jonathan Druart 2018-02-27 16:36:42 UTC
Created attachment 72271 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts
Comment 2 Jonathan Druart 2018-02-27 16:37:19 UTC
Created attachment 72272 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts
Comment 3 Jonathan Druart 2018-02-27 16:38:29 UTC
I am going to attach patches when I find these warnings.
Comment 4 Mark Tompsett 2018-04-02 00:46:47 UTC
Comment on attachment 72272 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts

Review of attachment 72272 [details] [review]:
-----------------------------------------------------------------

::: cataloguing/additem.pl
@@ +157,5 @@
>              my $temp2 = $temp->field($CNtag);
>              if ($temp2) {
> +                my $value = q{};
> +                $value .= $temp2->subfield($CNsubfield)  if $temp2->subfield($CNsubfield);
> +                $value .= $temp2->subfield($CNsubfield2) if $temp2->subfield($CNsubfield2);

Where's the space gone?
Comment 5 Jonathan Druart 2018-04-02 14:15:39 UTC
Created attachment 73522 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts
Comment 6 Jonathan Druart 2018-04-02 14:16:45 UTC
(In reply to M. Tompsett from comment #4)
> Comment on attachment 72272 [details] [review] [review]
> Bug 20304: Remove warnings from cataloguing scripts
> 
> Review of attachment 72272 [details] [review] [review]:
> -----------------------------------------------------------------
> 
> ::: cataloguing/additem.pl
> @@ +157,5 @@
> >              my $temp2 = $temp->field($CNtag);
> >              if ($temp2) {
> > +                my $value = q{};
> > +                $value .= $temp2->subfield($CNsubfield)  if $temp2->subfield($CNsubfield);
> > +                $value .= $temp2->subfield($CNsubfield2) if $temp2->subfield($CNsubfield2);
> 
> Where's the space gone?

lost, but I found it!
Comment 7 Jonathan Druart 2018-04-09 13:53:51 UTC
Created attachment 73869 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts
Comment 8 Mark Tompsett 2018-04-10 18:07:52 UTC
Set a default value for the holding branch in the default framework.
Add a manual record using the default framework.
In order to trigger all the code, I needed a value in 082$a
I then put crazy long values (>100) in text fields for the item and saved.
I made sure the full call number was set to something (I used 100$ab).
So yes, my data is horrible, but having triggered all the code, I know it works. :) And so much less floody.
Comment 9 Mark Tompsett 2018-04-10 18:09:20 UTC
Created attachment 73961 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Comment 10 Julian Maurice 2018-04-26 11:52:37 UTC
Created attachment 74876 [details] [review]
Bug 20304: Remove warnings from cataloguing scripts

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 11 Julian Maurice 2018-04-26 11:52:41 UTC
Created attachment 74877 [details] [review]
Bug 20304: (QA follow-up) Remove unwanted 'my'

'my' creates a new '$value' variable, and prevented the '$value' in
outer scope to be modified

Signed-off-by: Julian Maurice <julian.maurice@biblibre.com>
Comment 12 Jonathan Druart 2018-05-03 16:41:06 UTC
Pushed to master for 18.05, thanks to everybody involved!