Bug 16856 - unimarc plugin 4xx template noise
Summary: unimarc plugin 4xx template noise
Status: RESOLVED DUPLICATE of bug 16449
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low trivial
Assignee: Mark Tompsett
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-07-06 02:44 UTC by Mark Tompsett
Modified: 2016-07-15 14:12 UTC (History)
3 users (show)

See Also:
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 16856 - unimarc plugin 4xx template noise (2.35 KB, patch)
2016-07-06 02:58 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 16856 - unimarc plugin 4xx template noise (2.48 KB, patch)
2016-07-15 06:48 UTC, Marc Véron
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Tompsett 2016-07-06 02:44:55 UTC
Running prove t/db_dependent/FrameworkPlugin.t triggers UNIMARC 4xx plugin noise. Discovered while fixing 10148.
Comment 1 Mark Tompsett 2016-07-06 02:58:36 UTC Comment hidden (obsolete)
Comment 2 Marc Véron 2016-07-15 06:48:00 UTC
Created attachment 53409 [details] [review]
Bug 16856 - unimarc plugin 4xx template noise

While fixing 10148, prove t/db_dependent/FrameworkPlugin.t was
run. This triggers UNIMARC 4xx plugin noise.

The issue is that itypeloo.selected is not a property that
exists in the hash parameter to the template.

git grep cataloguing/value_builder/unimarc_field_4XX.tt | grep -v [.]po:
The above was used to confirm that there is only one file which
affects that template: cataloguing/value_builder/unimarc_field_4XX.pl

There is only one way for the Search value to evaluate to true:
the else case of the $op check (right at the bottom of the file).

The value passed to the itypeloop parameter is a full search from
Koha::ItemTypes->search, which has no parameters passed to it, and
does not return a 'selected' key as part of the array of hashes.

The logic to try to set "selected" in the template makes no sense,
as a result, since it is only called with a value that never has
"selected" set. The fix is easy: cut the useless code.

TEST PLAN
---------
1) prove t/db_dependent/FrameworkPlugin.t
   -- see unimarc 4xx related noise.
2) apply patch
3) prove t/db_dependent/FrameworkPlugin.t
   -- no more unimarc 4xx related noise.
4) run koha qa test tools

Signed-off-by: Marc Véron <veron@veron.ch>
Comment 3 Jonathan Druart 2016-07-15 14:12:51 UTC

*** This bug has been marked as a duplicate of bug 16449 ***