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)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 12 Sep 2017 14:30:40 +0000 (11:30 -0300)
commit7e222bb0796196f1e466b73d909fd28d529cab75
tree43e6969af304e8ffbcc0694da40305dba1dc7171
parent35e3de845c591958d66c6602940453f2a803a7ee
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>
authorities/authorities.pl