Bug 18811: Change visibility checks in authorities.pl
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Thu, 15 Jun 2017 10:30:27 +0000 (12:30 +0200)
committerFridolin Somers <fridolin.somers@biblibre.com>
Mon, 23 Oct 2017 13:31:46 +0000 (15:31 +0200)
commitae29acfb26548b32eff2a0cdaace0fe1fb5b2796
tree5b955e7d3e49443c0fa099983d7a82cc7dd0c277
parentd8e09eaec4b7bcbeb66a4e33fbe1adb2fc976fcf
Bug 18811: Change visibility checks in authorities.pl

The check is now <=-4 or >=5, but the framework uses 0 for Show all and
-5 for Hide all. (Note that sql installer scripts also use 8.)
When modifying an authority, the script also showed hidden fields when
filled, since it did not check the hidden field but only the tab field.

NOTE: The proposed solution restores consistency, but will remove hidden
fields from the MARC record.

Test plan:
[1] Set field 942a to Show all in an authority framework.
[2] Open a new record in this framework and verify that you see 942a.
[3] Edit an existing record in this framework and verify again.
[4] Set field 942a now to Hide all in this framework.
[5] Open a new record in this framework and verify that 942a is hidden.
[6] Edit an existing record in this framework and verify again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit 7e222bb0796196f1e466b73d909fd28d529cab75)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
authorities/authorities.pl