Bug 19367 - $biblio variable redefined in same scope in ISBDdetail
Summary: $biblio variable redefined in same scope in ISBDdetail
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low minor (vote)
Assignee: David Cook
QA Contact: Testopia
URL:
Keywords:
Depends on: 17736
Blocks:
  Show dependency treegraph
 
Reported: 2017-09-26 00:42 UTC by David Cook
Modified: 2018-06-04 20:18 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail (1.41 KB, patch)
2017-09-26 01:50 UTC, David Cook
Details | Diff | Splinter Review
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail (1.48 KB, patch)
2017-09-26 17:26 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail (1.53 KB, patch)
2017-10-07 02:16 UTC, Nick Clemens
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description David Cook 2017-09-26 00:42:03 UTC
I've been running "perl -c" through Koha files to check for compilation errors, and I came across the following:

my" variable $biblio masks earlier declaration in same scope at ./catalogue/ISBDdetail.pl line 171.

Sure enough, it looks like "my $biblio" is written twice in the same scope unnecessarily. I'll look at fixing that...
Comment 1 David Cook 2017-09-26 01:50:53 UTC
Created attachment 67356 [details] [review]
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail

The following warning is generated by ISBDdetail.pl:
my" variable $biblio masks earlier declaration in same scope
at ./catalogue/ISBDdetail.pl line 171.

This patch removes this unnecessary declaration, which removes the
warning.

_TEST PLAN_

After applying patch:

1) Check code compilation with "KOHA_CONF=/path/to/koha-conf.xml perl -c catalogue/ISBDdetail.pl"
2) Note the only message is "./catalogue/ISBDdetail.pl syntax OK"
2) On /cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=1,
view the source of the page and verify that the Javascript
contains a holdcount e.g. "var holdcount = 0".
Comment 2 Mark Tompsett 2017-09-26 13:18:16 UTC
I just need to check if $biblio isn't subject to spooky scoping action between those two points. It eyeballs well, though, without 'my' would be safe and not require any thought. :)
Comment 3 Jonathan Druart 2017-09-26 17:26:37 UTC
Created attachment 67370 [details] [review]
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail

The following warning is generated by ISBDdetail.pl:
my" variable $biblio masks earlier declaration in same scope
at ./catalogue/ISBDdetail.pl line 171.

This patch removes this unnecessary declaration, which removes the
warning.

_TEST PLAN_

After applying patch:

1) Check code compilation with "KOHA_CONF=/path/to/koha-conf.xml perl -c catalogue/ISBDdetail.pl"
2) Note the only message is "./catalogue/ISBDdetail.pl syntax OK"
2) On /cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=1,
view the source of the page and verify that the Javascript
contains a holdcount e.g. "var holdcount = 0".

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 4 Jonathan Druart 2017-09-26 17:27:05 UTC
(In reply to M. Tompsett from comment #2)
> I just need to check if $biblio isn't subject to spooky scoping action
> between those two points. It eyeballs well, though, without 'my' would be
> safe and not require any thought. :)

Looks safe to me.
Comment 5 Nick Clemens 2017-10-07 02:16:14 UTC
Created attachment 67780 [details] [review]
Bug 19367 - $biblio variable redefined in same scope in ISBDdetail

The following warning is generated by ISBDdetail.pl:
my" variable $biblio masks earlier declaration in same scope
at ./catalogue/ISBDdetail.pl line 171.

This patch removes this unnecessary declaration, which removes the
warning.

_TEST PLAN_

After applying patch:

1) Check code compilation with "KOHA_CONF=/path/to/koha-conf.xml perl -c catalogue/ISBDdetail.pl"
2) Note the only message is "./catalogue/ISBDdetail.pl syntax OK"
2) On /cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=1,
view the source of the page and verify that the Javascript
contains a holdcount e.g. "var holdcount = 0".

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 6 Jonathan Druart 2017-10-09 19:19:27 UTC
Pushed to master for 17.11, thanks to everybody involved!