Skip to content
Browse files

Fixes to C4::Auth, mainpage.pl, and install.pl so web installer can s…

…till run while RaiseError is enabled by default.

Also amends kohastructure.sql with some DROP TABL IFs.
  • Loading branch information...
1 parent d5416ab commit 3719e65263d1066af000b9246cc52ec34a5c3814 @pjones9 pjones9 committed Dec 3, 2010
Showing with 18 additions and 5 deletions.
  1. +2 −3 C4/Auth.pm
  2. +3 −1 installer/data/mysql/kohastructure.sql
  3. +4 −1 installer/install.pl
  4. +9 −0 mainpage.pl
View
5 C4/Auth.pm
@@ -33,7 +33,6 @@ use POSIX qw/strftime/;
# use utf8;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS $debug $ldap);
-my $opacbookbagName = C4::Context->preference('opacbookbagName') || "Cart";
BEGIN {
$VERSION = 3.02; # set version for version checking
$debug = $ENV{DEBUG} || 0 ;
@@ -395,7 +394,7 @@ sub get_template_and_user {
opaclayoutstylesheet => "" . C4::Context->preference("opaclayoutstylesheet"),
opacstylesheet => "" . C4::Context->preference("opacstylesheet"),
opacbookbag => "" . C4::Context->preference("opacbookbag"),
- opacbookbagName => $opacbookbagName,
+ opacbookbagName => C4::Context->preference('opacbookbagName') || "Cart",
opaccredits => "" . C4::Context->preference("opaccredits"),
opacheader => "" . C4::Context->preference("opacheader"),
opaclanguagesdisplay => "" . C4::Context->preference("opaclanguagesdisplay"),
@@ -874,7 +873,7 @@ sub checkauth {
opaclanguagesdisplay => C4::Context->preference("opaclanguagesdisplay"),
opacuserjs => C4::Context->preference("opacuserjs"),
opacbookbag => "" . C4::Context->preference("opacbookbag"),
- opacbookbagName => $opacbookbagName,
+ opacbookbagName => C4::Context->preference('opacbookbagName') || "Cart",
OpacCloud => C4::Context->preference("OpacCloud"),
OpacTopissue => C4::Context->preference("OpacTopissue"),
OpacAuthorities => C4::Context->preference("OpacAuthorities"),
View
4 installer/data/mysql/kohastructure.sql
@@ -541,6 +541,7 @@ CREATE TABLE `borrower_attributes` (
ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS `branch_item_rules`;
CREATE TABLE `branch_item_rules` (
`branchcode` varchar(10) NOT NULL,
`itemtype` varchar(10) NOT NULL,
@@ -710,6 +711,7 @@ CREATE TABLE `default_branch_circ_rules` (
-- Table structure for table `default_branch_item_rules`
--
+DROP TABLE IF EXISTS `default_branch_item_rules`;
CREATE TABLE `default_branch_item_rules` (
`itemtype` varchar(10) NOT NULL,
`holdallowed` tinyint(1) default NULL,
@@ -1557,7 +1559,7 @@ CREATE TABLE `old_reserves` (
`waitingdate` date default NULL,
`expirationdate` date default NULL,
`lowestPriority` tinyint(1) NOT NULL,
- `displayexpired` tinyint(1) NOT NULL default 1
+ `displayexpired` tinyint(1) NOT NULL default 1,
KEY `old_reserves_borrowernumber` (`borrowernumber`),
KEY `old_reserves_biblionumber` (`biblionumber`),
KEY `old_reserves_itemnumber` (`itemnumber`),
View
5 installer/install.pl
@@ -14,6 +14,9 @@
use CGI;
use IPC::Cmd;
+my $dbh = C4::Context->dbh;
+$dbh->{RaiseError} = 0;
+
my $query = new CGI;
my $step = $query->param('step');
@@ -46,7 +49,7 @@
$info{'port'} = C4::Context->config("port");
$info{'user'} = C4::Context->config("user");
$info{'password'} = C4::Context->config("pass");
-my $dbh = DBI->connect(
+$dbh = DBI->connect(
"DBI:$info{dbms}:dbname=$info{dbname};host=$info{hostname}"
. ( $info{port} ? ";port=$info{port}" : "" ),
$info{'user'}, $info{'password'}
View
9 mainpage.pl
@@ -19,11 +19,17 @@
use strict;
use CGI;
+
+use C4::Context;
+my $dbh = C4::Context->dbh;
+$dbh->{RaiseError} = 0;
+
use C4::Output;
use C4::Auth;
use C4::AuthoritiesMarc;
use C4::Koha;
use C4::NewsChannels;
+
my $query = new CGI;
my $authtypes = getauthtypes;
my @authtypesloop;
@@ -52,6 +58,9 @@
}
);
+# We've made it past the installer and can expect normal database function
+$dbh->{RaiseError} = 1;
+
my $marc_p = C4::Context->boolean_preference("marc");
$template->param(

0 comments on commit 3719e65

Please sign in to comment.
Something went wrong with that request. Please try again.