projects
/
koha_fer
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Bug 11703: (qa-followup) fix update database entry
[koha_fer]
/
installer
/
install.pl
diff --git
a/installer/install.pl
b/installer/install.pl
index
687d35e
..
389dabd
100755
(executable)
--- a/
installer/install.pl
+++ b/
installer/install.pl
@@
-4,12
+4,13
@@
use strict;
use warnings;
use diagnostics;
use warnings;
use diagnostics;
-use InstallAuth;
+use
C4::
InstallAuth;
use CGI;
use IPC::Cmd;
use C4::Context;
use C4::Output;
use CGI;
use IPC::Cmd;
use C4::Context;
use C4::Output;
+use C4::Templates;
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
use C4::Installer;
use C4::Languages qw(getAllLanguages getTranslatedLanguages);
use C4::Installer;
@@
-22,7
+23,7
@@
my ( $template, $loggedinuser, $cookie );
my $all_languages = getAllLanguages();
if ( defined($language) ) {
my $all_languages = getAllLanguages();
if ( defined($language) ) {
- setlanguagecookie( $query, $language, "install.pl?step=1" );
+
C4::Templates::
setlanguagecookie( $query, $language, "install.pl?step=1" );
}
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
}
( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
@@
-58,7
+59,7
@@
if ( $step && $step == 1 ) {
$template->param( language => 1 );
$template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are
$template->param( language => 1 );
$template->param( 'checkmodule' => 1 ); # we start with the assumption that there are no problems and set this to 0 if there are
- unless ( $] >= 5.0
08008 ) { # Bug 450
5
+ unless ( $] >= 5.0
10000 ) { # Bug 737
5
$template->param( problems => 1, perlversion => 1, checkmodule => 0 );
}
$template->param( problems => 1, perlversion => 1, checkmodule => 0 );
}
@@
-184,11
+185,10
@@
elsif ( $step && $step == 3 ) {
# we have finished, just redirect to mainpage.
#
print $query->redirect("/cgi-bin/koha/mainpage.pl");
# we have finished, just redirect to mainpage.
#
print $query->redirect("/cgi-bin/koha/mainpage.pl");
- exit
1
;
+ exit;
}
elsif ( $op && $op eq 'finish' ) {
$installer->set_version_syspref();
}
elsif ( $op && $op eq 'finish' ) {
$installer->set_version_syspref();
- $installer->set_indexing_engine(0); # use Zebra
# Installation is finished.
# We just deny anybody access to install
# Installation is finished.
# We just deny anybody access to install
@@
-228,6
+228,7
@@
elsif ( $step && $step == 3 ) {
# Framework Selection is achieved through checking boxes.
my $langchoice = $query->param('fwklanguage');
$langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
# Framework Selection is achieved through checking boxes.
my $langchoice = $query->param('fwklanguage');
$langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
+ $langchoice =~ s/[^a-zA-Z_-]*//g;
my $marcflavour = $query->param('marcflavour');
if ($marcflavour){
$installer->set_marcflavour_syspref($marcflavour);
my $marcflavour = $query->param('marcflavour');
if ($marcflavour){
$installer->set_marcflavour_syspref($marcflavour);
@@
-240,7
+241,7
@@
elsif ( $step && $step == 3 ) {
$template->param( "frameworksloop" => $fwklist );
$template->param( "marcflavour" => ucfirst($marcflavour));
$template->param( "frameworksloop" => $fwklist );
$template->param( "marcflavour" => ucfirst($marcflavour));
- my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice
, $marcflavour
);
+ my ($sample_defaulted_to_en, $levellist) = $installer->sample_data_sql_list($langchoice);
$template->param( "en_sample_data" => $sample_defaulted_to_en);
$template->param( "levelloop" => $levellist );
$template->param( "$op" => 1 );
$template->param( "en_sample_data" => $sample_defaulted_to_en);
$template->param( "levelloop" => $levellist );
$template->param( "$op" => 1 );
@@
-265,6
+266,7
@@
elsif ( $step && $step == 3 ) {
# Marcflavour Selection is achieved through radiobuttons.
my $langchoice = $query->param('fwklanguage');
$langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
# Marcflavour Selection is achieved through radiobuttons.
my $langchoice = $query->param('fwklanguage');
$langchoice = $query->cookie('KohaOpacLanguage') unless ($langchoice);
+ $langchoice =~ s/[^a-zA-Z_-]*//g;
my $dir =
C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/marcflavour";
unless (opendir( MYDIR, $dir )) {
my $dir =
C4::Context->config('intranetdir') . "/installer/data/$info{dbms}/$langchoice/marcflavour";
unless (opendir( MYDIR, $dir )) {
@@
-309,6
+311,15
@@
elsif ( $step && $step == 3 ) {
# Not 1st install, the only sub-step : update database
#
#Do updatedatabase And report
# Not 1st install, the only sub-step : update database
#
#Do updatedatabase And report
+
+ if ( ! defined $ENV{PERL5LIB} ) {
+ my $find = "C4/Context.pm";
+ my $path = $INC{$find};
+ $path =~ s/\Q$find\E//;
+ $ENV{PERL5LIB} = "$path:$path/installer";
+ warn "# plack? inserted PERL5LIB $ENV{PERL5LIB}\n";
+ }
+
my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl";
my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl";
my ($success, $error_code, $full_buf, $stdout_buf, $stderr_buf) = IPC::Cmd::run(command => $cmd, verbose => 0);
@@
-327,7
+338,7
@@
elsif ( $step && $step == 3 ) {
}
else {
#
}
else {
#
- # check wether it's a 1st install or an update
+ # check w
h
ether it's a 1st install or an update
#
#Check if there are enough tables.
# Paul has cleaned up tables so reduced the count
#
#Check if there are enough tables.
# Paul has cleaned up tables so reduced the count
@@
-371,8
+382,6
@@
elsif ( $step && $step == 3 ) {
);
}
}
);
}
}
-
- $dbh->disconnect;
}
}
else {
}
}
else {
@@
-388,8
+397,8
@@
else {
if ( $rq->execute ) {
my ($version) = $rq->fetchrow;
if ($version) {
if ( $rq->execute ) {
my ($version) = $rq->fetchrow;
if ($version) {
-
$query->redirect("
install.pl?step=3");
-
exit;
+
print $query->redirect("/cgi-bin/koha/installer/
install.pl?step=3");
+ exit;
}
}
}
}
}
}