Summary: | In Auth.pm the var OPACBaseURL ignores the syspref OPACBaseURL | ||
---|---|---|---|
Product: | Koha | Reporter: | Juan Romay Sieira <juan.sieira> |
Component: | Authentication | Assignee: | Juan Romay Sieira <juan.sieira> |
Status: | RESOLVED DUPLICATE | QA Contact: | Bugs List <koha-bugs> |
Severity: | normal | ||
Priority: | PATCH-Sent (DO NOT USE) | CC: | chris, dpavlin, f.demians, mtompset |
Version: | 3.4 | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: | proposed patch |
Description
Juan Romay Sieira
2011-04-08 12:55:38 UTC
Isn't OPACBaseURL about to be debrecated? The current code build the OPAC URL based on the http server environment variables. It's better. It means that if you change your domain name, it will be automatically reported, you won't have to change a Koha syspref. Hi Frederic, I think OpacBaseUrl is used in other places too. Like the links to opac from detail pages in intranet. And I think it's used in some mails too (mail your cart?). Don't know enough to say if it should be deprecated - but if we should take a look at those places too. Katrin (In reply to comment #2) > I think OpacBaseUrl is used in other places too. Like the links to opac from > detail pages in intranet. And I think it's used in some mails too (mail your > cart?). Don't know enough to say if it should be deprecated - but if we should > take a look at those places too. A quick look shows that OPACBaseURL is set in catalogue/detail.pl but not used anywhere in OPAC, and not in mail your cart template. But it seems that it has been added recently into MARC21 XSL in order to offer a link to OPAC from staff interface. I'm not sure it's a good idea, even if I can't see other mean to do it. OPACBaseURL is used in several places now, including the link to the OPAC from the detail page. It is used in the patch pending for Bug 6957. However, the way I've seen it used is to call the preference directly. In detail.pl: # Get OPAC URL if (C4::Context->preference('OPACBaseURL')){ $template->param( OpacUrl => C4::Context->preference('OPACBaseURL') ); } And build the link assuming that OPACBaseURL contains just the domain. In detail.tt: <a href="http://[% OPACBaseURL %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber %]" target="_blank">Open in new window</a> Before or after this patch, if I leave the OPACBaseURL system preference empty, the output of the OPACBaseURL variable generated by Auth.pm is empty as well. I suspect something is wrong in the way the code builds the URL with or without this patch. |