[Koha-bugs] [Bug 33080] Add helpers that return result_set for further processing

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 2 18:30:22 CET 2023


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

--- Comment #4 from Martin Renvoize <martin.renvoize at ptfs-europe.com> ---
Comment on attachment 147662
  --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=147662
Bug 33080: Introduce objects.search_rs, objects.find_rs and objects.to_api

Review of attachment 147662:
 --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=33080&attachment=147662)
-----------------------------------------------------------------

::: Koha/REST/Plugin/Objects.pm
@@ +243,3 @@
>  
>              # Perform search
>              my $objects = $result_set->search( $filtered_params, $attributes );

I think we need to rework the pagination handling a little for this change.  We
can't really keep it inside this method now that it returns a resultset that
we're expecting developers to then further filter and refine.

I think we should update the add_pagination_headers helper to accept a
resultset.. it can then build the total and base_total fields itself by
executing the count and looking at the pager in the resultset passed.

We could then call this automatically in the non-rs search header above and
document that it should be called by the developer in their controller after
they've applied their own additional filtering etc in the controller if they're
using the _rs helper.

For this.. I'm failing QA.. But I do really like where this is headed.

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


More information about the Koha-bugs mailing list