]> git.evergreen-ils.org Git - Evergreen.git/commit
LP#1710747: Absolute URL for media_prefix in templates
authorDan Scott <dscott@laurentian.ca>
Tue, 15 Aug 2017 14:19:22 +0000 (10:19 -0400)
committerKathy Lussier <klussier@masslnc.org>
Wed, 23 Aug 2017 16:34:43 +0000 (12:34 -0400)
commit5368363fd0cf2f1a21f30ec12b0a66b0f72924aa
treeb36d4c65c95818f8c5eff3043875fd64e6f0daba
parent836a0b895d3194715894708e2597643268d524c9
LP#1710747: Absolute URL for media_prefix in templates

If OILSWebMediaPrefix is set in the Apache configuration, then
the ctx.media_prefix TT2 template variable uses that value as the
hostname; otherwise it is null, resulting in many relative URLs for
images, CSS, and JavaScript files.

Normally this is not a problem, but the Open Graph image property
requires a full absolute URL rather than the relative URL that would
previously result on the record summary page in the absence of the
OILSWebMediaPrefix variable having been set in the Apache config.

This patch tweaks the EGWeb handler to fall back to the base hostname in
the absence of the OILSWebMediaPrefix variable, thus ensuring that all
uses of ctx.media_prefix result in an absolute URL.

Test Plan:
Pre-patch - Visit a record summary page in the catalog. View the source of the
page. In the head section, find the og:image meta property. The content will
display a relative URL to the record's book jacket cover image.

Post-patch - When viewing the source of the page, og:image will display the
full URL.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm