Bug 21036: Fix warnings from C4/Biblio
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 5 Jul 2018 07:53:57 +0000 (09:53 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Wed, 8 May 2019 15:48:31 +0000 (16:48 +0100)
commit6413f40738185f5319c66b763cb5bedc6fba8745
treeb22047fd359f92150c66ac4bcff82dfaf65c92ea
parentffae11293afb3f80e434e7c84b75e240f7512350
Bug 21036: Fix warnings from C4/Biblio

Use of uninitialized value $isbn in string ne at /usr/share/koha/prodclone/C4/Biblio.pm line 1794. (16.11 line number)
Trivial edit.

And these warnings from TransformHtmlToXml (with 16.11 line numbers):
Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2527.
Use of uninitialized value in substr at /usr/share/koha/prodclone/C4/Biblio.pm line 2528.
substr outside of string at /usr/share/koha/prodclone/C4/Biblio.pm line 2528.
Indicator in 952 is empty at /usr/share/koha/prodclone/C4/Biblio.pm line 2534.

The last warning is not needed and can be removed.
Note that the code used the construct @$indicator[$j] for $$indicator[$j].
The first is an array slice. This worked in list context. But apparently
the second was meant to be used. And can be rewritten as $indicator->[$j]
which generally is considered more readable.
The code around indicator1/2 and ind1/2 is simplified. This change is applied
twice in the same sub.

Test plan:
Read the changes.
Run t/Biblio/TransformHtmlToXml.t

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
(cherry picked from commit 295e9b1054386cf188c5fc1eb4fd590e5c451513)
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Biblio.pm