[Koha-bugs] [Bug 14646] Koha::RecordProcessor only accepts one filter at a time

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Aug 6 00:14:44 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646

M. Tompsett <mtompset at hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #41389|0                           |1
        is obsolete|                            |

--- Comment #4 from M. Tompsett <mtompset at hotmail.com> ---
Created attachment 41392
  -->
http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41392&action=edit
Bug 14646: Koha::RecordProcessor should accept more than one filter

The docs say that Koha::RecordProcessor accepts more than one filter
at a time. But as the regression tests show it doesn't.

This is really important to extend its usage in record processing
(either to enforce policy, transform, etc).

This patch makes ->new evaluate the reference type of the passed filters
and builds an array with a single item if a scalar has been passed. The
loop now explicitly casts the filters as an array.

To test:
- Apply the test patch
- Run
  $ prove t/RecordProcessor.t
=> FAIL: tests fail because Koha::RecordProcessor doesn't hanlde
         more than one filter at a time.
- Apply this patch
- Run
  $ prove t/RecordProcessor.t
=> SUCCESS: tests now pass
- Easy, right? Sign off :-D

NOTE: Read code. Don't like the ? operator logic, but it is
      functional despite readability issues.

Signed-off-by: Mark Tompsett <mtompset at hotmail.com>

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


More information about the Koha-bugs mailing list