[Bug 14646] New: Koha::RecordProcessor only accepts one filter at a time
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Bug ID: 14646 Summary: Koha::RecordProcessor only accepts one filter at a time Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: gmcharlt@gmail.com Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Koha::RecordProcessor is designed and documented to accept more than one Koha::Filter as parameter. The current code only support one filter to be passed. Regression test coming- -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|gmcharlt@gmail.com |tomascohen@gmail.com CC| |jcamins@cpbibliography.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |14645 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14645 [Bug 14645] Koha::RecordProcessor should deal with Koha::MetadataRecord objects -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 --- Comment #1 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 41388 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41388&action=edit Bug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time This patch introduces new tests to t/RecordProcessor.t so it tests for creating processors with more than one filter. It does so by running my $processor = new Koha::RecordProcessor({ filters => ['Null','Dummy'] }); and testing the results. To test: - Apply the patch - Run: $ prove t/RecordProcessor.t => FAIL: tests related to multiple filters fail. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 --- Comment #2 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Created attachment 41389 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41389&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: - Run $ prove t/RecordProcessor.t => FAIL: tests fail because Koha::RecordProcessor doesn't hanlde more than one filter at a time. - Apply the patch - Run $ prove t/RecordProcessor.t => SUCCESS: tests now pass - Easy, right? Sign off :-D -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41388|0 |1 is obsolete| | --- Comment #3 from M. Tompsett <mtompset@hotmail.com> --- Created attachment 41391 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41391&action=edit Bug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time This patch introduces new tests to t/RecordProcessor.t so it tests for creating processors with more than one filter. It does so by running my $processor = new Koha::RecordProcessor({ filters => ['Null','Dummy'] }); and testing the results. To test: - Apply the patch - Run: $ prove t/RecordProcessor.t => FAIL: tests related to multiple filters fail. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41389|0 |1 is obsolete| | --- Comment #4 from M. Tompsett <mtompset@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@hotmail.com> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 M. Tompsett <mtompset@hotmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |mtompset@hotmail.com -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #41391|0 |1 is obsolete| | Attachment #41392|0 |1 is obsolete| | --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 41655 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41655&action=edit Bug 14646: (regression test) Koha::RecordProcessor only accepts one filter at a time This patch introduces new tests to t/RecordProcessor.t so it tests for creating processors with more than one filter. It does so by running my $processor = new Koha::RecordProcessor({ filters => ['Null','Dummy'] }); and testing the results. To test: - Apply the patch - Run: $ prove t/RecordProcessor.t => FAIL: tests related to multiple filters fail. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 41656 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=41656&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@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jonathan.druart@bugs.koha-c | |ommunity.org --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to M. Tompsett from comment #4)
NOTE: Read code. Don't like the ? operator logic, but it is functional despite readability issues.
Something better to suggest? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 --- Comment #8 from M. Tompsett <mtompset@hotmail.com> --- (In reply to Jonathan Druart from comment #7)
(In reply to M. Tompsett from comment #4)
NOTE: Read code. Don't like the ? operator logic, but it is functional despite readability issues.
Something better to suggest?
As noted it is merely readability issues. I do not have anything better to suggest. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14646 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com Status|Passed QA |Pushed to Master --- Comment #9 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Patches pushed to master. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org