Bug 23714 - Problem with ILLModuleUnmediated
Summary: Problem with ILLModuleUnmediated
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor (vote)
Assignee: Bugs List
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-10-01 14:56 UTC by Magnus Enger
Modified: 2023-12-28 20:42 UTC (History)
0 users

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Magnus Enger 2019-10-01 14:56:42 UTC
If you run this:

$ sudo koha-shell -c "prove t/db_dependent/Illrequests.t" kohadev

you get this:

Use of uninitialized value in concatenation (.) or string at /home/vagrant/kohaclone/Koha/Illrequest.pm line 857.
Use of uninitialized value in concatenation (.) or string at /home/vagrant/kohaclone/Koha/Illrequest.pm line 859

(Among some other warnings that are fixed on bug 23712.)

Lines 857 and 859 look like this:

    my $intra_tmpl =  join "/", $backend_tmpl, "intra-includes",
        $params->{method} . ".inc";
    my $opac_tmpl =  join "/", $backend_tmpl, "opac-includes",
        $params->{method} . ".inc";

$params->{method} is uninitialized because of these lines in Koha::Illrequest::backend_create():

    if ( C4::Context->preference("ILLModuleUnmediated") && $permitted ) {
        my $unmediated_result = $self->_backend_capability(
            'unmediated_ill',
            $args
        );
        $result = $unmediated_result if $unmediated_result;
    }

This replaces whatever was in $result. So before this code you can have a $result that looks like this:

$VAR1 = {
          'stage' => 'commit',
          'method' => 'create',
          'permitted' => 1
        };

and after the code it looks like this:

$VAR1 = {
          'unmediated_ill' => 1
        };

Is this the intended behaviour? If no, we should fix it (add 'unmediated_ill' => 1 to the existing data instead of replacing it?). If yes, we should make expandTemplate() handle a missing method more gracefully.
Comment 1 Katrin Fischer 2023-01-13 12:01:44 UTC
There are no longer any warns when running the tests, I assume this has been fixed since.