[Koha-bugs] [Bug 23681] Make patron restrictions user definable

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Aug 19 20:35:09 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23681

Tomás Cohen Arazi <tomascohen at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|Passed QA                   |Failed QA

--- Comment #317 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
Ok, this is almost done. I added some required follow-ups.

But the remaining things are too much for me to take care right now, so failing
it and adding my (not so big) list:

- The test files should be moved to Koha/RestrictionType*.t [MINOR]

- The tests do not cover all the things. They are also mixed. The
RestrictionType.t file tests Koha::RestrictionTypes->keyed_on_code

- Koha::RestrictionTypes->keyed_on_code is not really required... and is very
different than our normal return values... The fact we need to delete
everything in order to test it points to some design issue (i.e. it is not a
method that acts on $self as a resultset, but works in the whole table.

- keyed_on_code should be replaced by something along the lines of:

  { map { $_->{code} => $_ } $self->as_list }

- Koha::RestrictionType->make_default looks great :-D

- Koha::RestrictionType->delete has problems. We *could* accept it using plain
SQL, but the logic is wrong. If the type is a system one, and exception should
be thrown. The same if it is the default ;-) (i.e. it is setting itself as
default (again) and then deleting itself).

As you can see, we are close to pushing this. Please hurry so no rebases are
needed.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list