 +
      enable "ReverseProxy";
      enable "Plack::Middleware::Static";
-     # + is required so Plack doesn't try to prefix Plack::Middleware::+     # + is required so Plack doesn't try to prefix Plack::Middleware::

@@ -45,6 +45,8 @@ use Koha::AuthorisedValues;
 use Koha::Patrons;
 use Koha::Virtualshelves;
+Koha::Util::PureFunctions::pure {
+
 my $query = CGI->new();
 my $analyze = $query->param('analyze');
@@ -515,3 +517,4 @@ $template->param (basketsorders => \@baskets_orders);
 $template->param (basketsdeletedorders => \@baskets_deletedorders);
 output_html_with_http_headers $query, $cookie, $template->output;
+};
diff --git a/debian/templates/plack.psgi b/debian/templates/plack.psgi

+++ b/C4/Circulation.pm
@@ -68,8 +68,10 @@ use Date::Calc qw(
 use vars qw(@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);

 BEGIN {
+    require Koha::Util::PureFunctions;
     require Exporter;
-    @ISA    = qw(Exporter);
+
+@ISA    = qw(Koha::Util::PureFunctions Exporter );

     # FIXME subs that should probably be elsewhere
     push @EXPORT, qw(
@@ -1685,7 +1687,7 @@ Neither C<$branchcode> nor C<$itemtype> should be '*'.

 =cut

-sub GetBranchItemRule {
+sub GetBranchItemRule : PureFunction {
     my ( $branchcode, $itemtype ) = @_;
     my $dbh = C4::Context->dbh();
     my $result = {};
@@ -2617,7 +2619,7 @@ already renewed the loan. $error will contain the reason the renewal can not pro

 =cut

-sub CanBookBeRenewed {
+sub CanBookBeRenewed : PureFunction {
     my ( $borrowernumber, $itemnumber, $override_limit ) = @_;

     my $dbh    = C4::Context->dbh;
diff --git a/C4/Items.pm b/C4/Items.pm
index 2188ca4..1be9998 100644
