From 1b4558ee80c5fd245bf163026906484b8b59fd4c Mon Sep 17 00:00:00 2001 From: Tom Reijnders Date: Tue, 12 Jul 2022 12:02:08 +0200 Subject: [PATCH] Typo in scorm/scorm2004_library.php - %LANGUAGE was replaced instead of %LANGUAGE% - This caused scorm 2004 3rd packages to fail --- modules/decision/player_html5/rloObject.htm | 12 +++++++++--- modules/site/player_html5/rloObject.htm | 13 ++++++++++--- modules/xerte/player_html5/rloObject.htm | 12 +++++++++--- website_code/php/scorm/scorm2004_library.php | 2 +- 4 files changed, 29 insertions(+), 10 deletions(-) diff --git a/modules/decision/player_html5/rloObject.htm b/modules/decision/player_html5/rloObject.htm index cb913a118d..805f35d08d 100644 --- a/modules/decision/player_html5/rloObject.htm +++ b/modules/decision/player_html5/rloObject.htm @@ -67,12 +67,18 @@ var x_templateLocation = "%TEMPLATEPATH%"; var themePath = "%THEMEPATH%"; var projectXML = "%XMLFILE%"; //this is the file to read, not the xml - var localeoptions = { weekday: undefined, year: 'numeric', month: 'short', day: 'numeric' }; var x_lastUpdated = new Date("%LASTUPDATED%"); var x_dateCreated = new Date("%DATECREATED%"); var x_numPlays = String("%NUMPLAYS%"); - var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); - var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + var localeoptions = { year: 'numeric', month: 'short', day: 'numeric' }; + try { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + } + catch(e) { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString(); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString(); + } %USE_URL% var globalVars = { diff --git a/modules/site/player_html5/rloObject.htm b/modules/site/player_html5/rloObject.htm index 08174b0bc9..2a5ae794f3 100644 --- a/modules/site/player_html5/rloObject.htm +++ b/modules/site/player_html5/rloObject.htm @@ -78,12 +78,19 @@ var x_youtube_api_key = "%YOUTUBEAPIKEY%"; var x_Version = "%VERSION%"; var projectXML = "%XMLFILE%"; //this is the file to read, not the xml - var localeoptions = { weekday: undefined, year: 'numeric', month: 'short', day: 'numeric' }; var x_lastUpdated = new Date("%LASTUPDATED%"); var x_dateCreated = new Date("%DATECREATED%"); var x_numPlays = String("%NUMPLAYS%"); - var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); - var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + var localeoptions = { year: 'numeric', month: 'short', day: 'numeric' }; + try { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + } + catch(e) { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString(); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString(); + } + var globalhidesocial="%GLOBALHIDESOCIAL%"; var globalsocialauth="%GLOBALSOCIALAUTH%"; %USE_URL% diff --git a/modules/xerte/player_html5/rloObject.htm b/modules/xerte/player_html5/rloObject.htm index cee6a73f9c..8871165245 100644 --- a/modules/xerte/player_html5/rloObject.htm +++ b/modules/xerte/player_html5/rloObject.htm @@ -129,12 +129,18 @@

var x_TemplateId = "%TEMPLATEID%"; var x_youtube_api_key = "%YOUTUBEAPIKEY%"; var x_Version = "%VERSION%"; - var localeoptions = { weekday: undefined, year: 'numeric', month: 'short', day: 'numeric' }; var x_lastUpdated = new Date("%LASTUPDATED%"); var x_dateCreated = new Date("%DATECREATED%"); var x_numPlays = String("%NUMPLAYS%"); - var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); - var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + var localeoptions = { year: 'numeric', month: 'short', day: 'numeric' }; + try { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString("%LANGUAGE%", localeoptions); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString("%LANGUAGE%", localeoptions); + } + catch(e) { + var x_lastUpdatedLocale = x_lastUpdated.toLocaleDateString(); + var x_dateCreatedLocale = x_dateCreated.toLocaleDateString(); + } %USE_URL% var globalVars = { diff --git a/website_code/php/scorm/scorm2004_library.php b/website_code/php/scorm/scorm2004_library.php index 339842bf94..e112bff3ba 100644 --- a/website_code/php/scorm/scorm2004_library.php +++ b/website_code/php/scorm/scorm2004_library.php @@ -217,7 +217,7 @@ function scorm2004_html5_page_create($id, $type, $parent_name, $lo_name, $langua $scorm_html_page_content = file_get_contents($xerte_toolkits_site->basic_template_path . $type . "/player_html5/rloObject.htm"); - $scorm_html_page_content = str_replace("%LANGUAGE", $language_ISO639_1code, $scorm_html_page_content); + $scorm_html_page_content = str_replace("%LANGUAGE%", $language_ISO639_1code, $scorm_html_page_content); $scorm_html_page_content = str_replace("%VERSION%", $version , $scorm_html_page_content); $scorm_html_page_content = str_replace("%TWITTERCARD%", "",$scorm_html_page_content); $scorm_html_page_content = str_replace("%VERSION_PARAM%", "" , $scorm_html_page_content);