From a6ce64229e55826640e056f6d6a9e49bf65c5b1d Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 8 Dec 2004 10:41:38 +0000 Subject: [PATCH] bugfix for CVS installations of Koha & modperl --- admin/marc_subfields_structure.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 1c5d9e9bd6..1686929685 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -133,8 +133,15 @@ if ($op eq 'add_form') { # build value_builder list my @value_builder=(''); - my $cgidir = C4::Context->intranetdir . "/cgi-bin"; - opendir(DIR, "$cgidir/value_builder") || die "can't opendir $cgidir/value_builder: $!"; + # read value_builder directory. + # 2 cases here : on CVS install, $cgidir does not need a /cgi-bin + # on a standard install, /cgi-bin need to be added. + # test one, then the other + my $cgidir = C4::Context->intranetdir ."/cgi-bin"; + unless (opendir(DIR, "$cgidir/value_builder")) { + $cgidir = C4::Context->intranetdir; + opendir(DIR, "$cgidir/value_builder") || die "can't opendir $cgidir/value_builder: $!"; + } while (my $line = readdir(DIR)) { if ($line =~ /\.pl$/) { push (@value_builder,$line); -- 2.39.5