[Koha-bugs] [Bug 29523] Add a way to prevent embedding objects that should not be allowed

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Oct 20 11:53:35 CEST 2023


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

--- Comment #156 from Marcel de Rooy <m.de.rooy at rijksmuseum.nl> ---
(In reply to Martin Renvoize from comment #154)
> Basically we need a fresh Koha::Patron object so that we flush the object
> level micro cache that was introduced in the patch (the micro cache was
> introduced to improve performance when this is called in a large loop, for
> example an embed call with many related objects being returned). I don't
> think we can do a simple discard_changes as that only flushes the dbic level
> result cache and not the localised object caching we employ here.

Clear.

> It's a good question.. I ran the full api test suit and ripgrepped for
> to_api manually too.  Not sure there's an easy way to automate further. 
> What we really need is for anywhere patron can be embedded in the API
> schema, for there to be a corresponding api unit test.. I think when I last
> checked that was a pretty solid assumption.. but that may have changed since.

Looking at for instance (Koha/REST/Plugin/Objects.pm):

    $app->helper(
        'objects.find' => sub {
            my ( $c, $result_set, $id ) = @_;
            my $object = $c->objects->find_rs( $result_set, $id );
            return unless $object;
            return $c->objects->to_api($object);
        }
    );

So what if the object is a patron?

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


More information about the Koha-bugs mailing list