Skip to content

Commit

Permalink
Switch from use to runtime require
Browse files Browse the repository at this point in the history
  • Loading branch information
kylemhall committed Aug 11, 2020
1 parent 8fe5db4 commit 22079b0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 10 additions & 7 deletions Koha/Plugin/Com/ByWaterSolutions/CurbsidePickup.pm
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@ use base qw(Koha::Plugins::Base);
use File::Slurp qw(read_file);
use Cwd qw(abs_path);

use Koha::CurbsidePickups;
use Koha::CurbsidePickupPolicies;
use Koha::Schema::Result::CurbsidePickupPolicy;
use Koha::Schema::Result::CurbsidePickup;

use C4::Auth;
use C4::Context;
use C4::Circulation;
Expand Down Expand Up @@ -46,6 +41,11 @@ sub new {
}

sub tool {
require Koha::CurbsidePickups;
require Koha::CurbsidePickupPolicies;
require Koha::Schema::Result::CurbsidePickupPolicy;
require Koha::Schema::Result::CurbsidePickup;

my ( $self, $args ) = @_;

my $cgi = $self->{'cgi'};
Expand Down Expand Up @@ -224,6 +224,11 @@ sub intranet_js {
}

sub configure {
require Koha::CurbsidePickups;
require Koha::CurbsidePickupPolicies;
require Koha::Schema::Result::CurbsidePickupPolicy;
require Koha::Schema::Result::CurbsidePickup;

my ( $self, $args ) = @_;
my $cgi = $self->{'cgi'};

Expand Down Expand Up @@ -287,7 +292,6 @@ sub configure {
sub install() {
my ( $self, $args ) = @_;

warn "INSTALLING";
my $dbh = C4::Context->dbh;

$dbh->do(
Expand Down Expand Up @@ -354,7 +358,6 @@ CREATE TABLE `curbside_pickups` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
}
);
warn "FINISHED INSTALL!";

return 1;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ use Modern::Perl;

use Mojo::Base 'Mojolicious::Controller';

use Koha::CurbsidePickups;

use Koha::Libraries;
use Koha::DateUtils;

Expand Down

0 comments on commit 22079b0

Please sign in to comment.