[Koha] Kitchen sink plugin and GetBranchName

Mark Alexander marka at pobox.com
Thu Sep 14 01:56:07 NZST 2017


In order to learn how to write a plugin, I installed the Kitchen sink plugin:

  https://github.com/bywatersolutions/koha-plugin-kitchen-sink

into stock Koha 17.05.  When I ran the plugin's report tool, I got
this error:

  Undefined subroutine &Koha::Plugin::Com::ByWaterSolutions::KitchenSink::GetBranchName called at /var/lib/koha/rpl/plugins/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm line 372.

The code in question is this:

    $template->param(
        date_ran     => dt_from_string(),
        results_loop => \@results,
        branch       => GetBranchName($branch),
    );

After poking around in the Koha git repository, I saw that GetBranchName
was removed by this commit:

  commit 19a977dc7b779173c4a3e96b6b06dc35db663601
  Author: Jonathan Druart <jonathan.druart at bugs.koha-community.org>
  Date:   Tue Feb 2 17:28:30 2016 +0000

      Bug 15758: Koha::Libraries - Remove GetBranchName

I was able to fix the plugin by replacing the line with the GetBranchName call
with this line:

        branch       => Koha::Libraries->find($branch)->branchname,


More information about the Koha mailing list