View | Details | Raw Unified | Return to bug 35963
Collapse All | Expand All

(-)a/Koha/REST/V1/Items.pm (-2 / +9 lines)
Lines 294-301 sub bundled_items { Link Here
294
    }
294
    }
295
295
296
    return try {
296
    return try {
297
        my $items_set = $item->bundle_items;
297
        my $items_set = Koha::Items->search(
298
        my $items     = $c->objects->search( $items_set );
298
            {
299
                'item_bundles_item.host' => $item_id,
300
            },
301
            {
302
                join => 'item_bundles_item',
303
            }
304
        );
305
        my $items = $c->objects->search($items_set);
299
        return $c->render(
306
        return $c->render(
300
            status  => 200,
307
            status  => 200,
301
            openapi => $items
308
            openapi => $items
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-1 / +1 lines)
Lines 1907-1913 Link Here
1907
                            "data": "lost_status:last_seen_date:return_claim.patron",
1907
                            "data": "lost_status:last_seen_date:return_claim.patron",
1908
                            "title": _("Status"),
1908
                            "title": _("Status"),
1909
                            "searchable": false,
1909
                            "searchable": false,
1910
                            "orderable": true,
1910
                            "orderable": false,
1911
                            "render": function(data, type, row, meta) {
1911
                            "render": function(data, type, row, meta) {
1912
                                if ( row.lost_status == bundle_lost_value ) {
1912
                                if ( row.lost_status == bundle_lost_value ) {
1913
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
1913
                                    let out = '<span class="lost">' + _("Last seen") + ': ' + $date(row.last_seen_date) + '</span>';
(-)a/t/db_dependent/api/v1/items/bundled_items.t (-1 / +48 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/env perl
2
3
use Modern::Perl;
4
5
use Test::More tests => 1;
6
use Test::MockModule;
7
use Test::Mojo;
8
9
use t::lib::TestBuilder;
10
use t::lib::Mocks;
11
12
use Koha::Database;
13
14
my $schema  = Koha::Database->new->schema;
15
my $builder = t::lib::TestBuilder->new;
16
17
t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
18
19
my $t = Test::Mojo->new('Koha::REST::V1');
20
21
subtest 'order by me.barcode should return 200' => sub {
22
    plan tests => 2;
23
24
    $schema->storage->txn_begin;
25
26
    my $bundle = $builder->build_sample_item;
27
    my $item   = $builder->build_sample_item;
28
    $bundle->add_to_bundle($item);
29
30
    my $patron = $builder->build_object(
31
        {
32
            class => 'Koha::Patrons',
33
            value => { flags => 4 }
34
        }
35
    );
36
37
    my $password = 'thePassword123';
38
39
    $patron->set_password( { password => $password, skip_validation => 1 } );
40
41
    my $userid = $patron->userid;
42
    my $itemnumber = $bundle->itemnumber;
43
44
    $t->get_ok( "//$userid:$password@/api/v1/items/$itemnumber/bundled_items?_order_by=+me.barcode" )
45
        ->status_is(200);
46
47
    $schema->storage->txn_rollback;
48
};

Return to bug 35963