[Koha] Weird PERL behaviour

Phill Hardstaff phillh at spc.int
Wed Apr 13 14:26:06 NZST 2005


OK, I realise I am probably on my own here as I am probably the only person on earth running Koha with IIS :) But if someone could explain this to me I would be very grateful. It's a bit of a complex read :)

Problem is is with Intranet pages, Catalogue. I am using the default theme, but have seen the same behaviour with NPL because the root pages are the same no matter what theme you use, like loadmodules.pl.

So, the problem. (Intranet pages)

Click on Catalogue

Click on Add Biblio, this calls 

http://koha.spc.int/cgi-bin/koha/loadmodules.pl?module=addbiblio&type=intranet

Now if I click on "create empty biblio" it calls

http://koha.spc.int/cgi-bin/koha/addbiblio.pl

Which does not exist and I get a 404 error, it should be calling

http://koha.spc.int/cgi-bin/koha/acqui.simple/addbiblio.pl

So, if you look in loadmodules.pl you find this

sub addbiblio {
	my $marc_bool = C4::Context->boolean_preference("MARC") || 0;
		if ($marc_bool eq "1") {
			print $input->redirect("/cgi-bin/koha/acqui.simple/addbooks.pl");
		} else {
			print $input->redirect("/cgi-bin/koha/acqui.simple/addbiblio-nomarc.pl");
		}

So the above URL should redirect to 

http://koha.spc.int/cgi-bin/koha/acqui.simple/addbooks.pl

And well, it sort of does, I get what looks like this page but 

http://koha.spc.int/cgi-bin/koha/loadmodules.pl?module=addbiblio&type=intranet

Stays in the address bar

So I modified the PERL code like this

sub addbiblio {
	my $marc_bool = C4::Context->boolean_preference("MARC") || 0;
		if ($marc_bool eq "1") {
			print $input->redirect("http://koha.spc.int/cgi-bin/koha/acqui.simple/addbooks.pl");
		} else {
			print $input->redirect("/cgi-bin/koha/acqui.simple/addbiblio-nomarc.pl");
		}

Ie put the whole URL in and it works. It goes to the right page

http://koha.spc.int/cgi-bin/koha/acqui.simple/addbooks.pl

Is now in the address bar and clicking create empty biblio now opens

http://koha.spc.int/cgi-bin/koha/acqui.simple/addbiblio.pl

Does this make any sense to anyone, it's probably just a PERL/Apache thing that Linux understands but Activestate/IIS does not, like from the code it should redirect to /cgi-bin/koha/acqui.simple/addbooks.pl but it won't unless I put the whole URL.

This also fixes a weird problem I had with NPL when it called anything using loadmodules.pl.

Cheers

Phill

-- 

Phill Hardstaff
MCSA, CCNA, A+, Network+, Inet+, Server+
Senior Support Engineer
Secretariat of the Pacific Community
B.P. D5
Noumea Cedex
98848
New Caledonia

Phone +687-260141
Mobile +687 838091
Fax +687-263818
Email phillh at spc.int
SPC Web Page http://www.spc.int/
_______________________________________________
Koha mailing list
Koha at lists.katipo.co.nz
http://lists.katipo.co.nz/mailman/listinfo/koha




More information about the Koha mailing list