Home - Waterfall Grid T-Grid Console Builders Recent Builds Buildslaves Changesources - JSON API - About

Change #4551

Category None
Changed by Dan Scott <dscottohnoyoudont@laurentian.ca>
Changed at Wed 23 Aug 2017 12:32:37
Repository git://git.evergreen-ils.org/Evergreen.git
Project Evergreen
Branch master
Revision 3725e10a63d41452ffc6951908d7c89ada82fe73

Comments

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>

Changed files