Correct spelling of HTTP_REFERER variable #1641
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
No value has been populated in jos_courses_asset_views.referrer column since 2013, presumably because no variable named HTTP_REFERRER is set (whereas HTTP_REFERER may be).
This small fix corrects the spelling of the variable so that this information can be populated in the Hub database. (It's extra amusing since the variable name itself is famously misspelled!)
Motivation
See JIRA NCN-467 (https://sdx-sdsc.atlassian.net/browse/NCN-467). Nanohub is working to gather information about student use of courses. Goals are to collect and present metrics on course usage; market courses to appropriate markets; and recommend potential next courses to users. The 'referrer' column in jos_courses_asset_views is needed to provide input data for the recommender system.
While HTTP_REFERER may be empty for various reasons, (see https://stackoverflow.com/questions/6880659/in-what-cases-will-http-referer-be-empty) it will certainly be empty if misspelled.
Testing
Admittedly no testing has been done. The variable name has been changed in place on Nanohub, since this is a very safe fix. It is self-contained--the code checks for the var (with correct spelling) being set, and if so, uses its value to set the database column contents.
Live patching Nanohub with this fix would be appreciated as we would like this change to 'stick' for testing/verification.