[Koha-bugs] [Bug 33556] $c->validation should be avoided (part 1)
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Fri Jul 21 15:54:11 CEST 2023
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33556
--- Comment #28 from Tomás Cohen Arazi <tomascohen at gmail.com> ---
(In reply to Jonathan Druart from comment #27)
> > (2) The ERM missing changes I'm referring to, are not those on that patch,
> > but the fact this modules make use of `my $args = $c->validation->output` to
> > be passed to the specific classes implementing the business logic for each
> > case, and I didn't 100% understand how things worked (they feel a bit hacky)
> > so wasn't sure about the right way to do it.
>
> It certainly feels hacky, but I will someone to explain how to fix them
> properly.
> We are not manipulating usual Koha::Objects here, we are pulling data for an
> external service and serve it to the Koha ERM Vue app. So we cannot use the
> regular REST::Plugin::, we are trying to behave the same as the other
> objects so that the app does not need to do different for those endpoints.
I mean this:
my $args = $c->validation->output;
my $ebsco = Koha::ERM::Providers::EBSCO->new;
...
my $total = $result->{totalResults};
$total = 10000 if $total > 10000;
$c->add_pagination_headers(
{
base_total => $base_total,
page => $page,
per_page => $per_page,
query_params => $args,
total => $total,
}
);
and similar. I wasn't sure how relevant the $args are here. I also feels like
it is not entirely correct, as $c->validation->output actually contains path
parameters, not just query params. So I felt like I didn't have enough
information to fix it.
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list