Moodle
  1. Moodle
  2. MDL-31397

French lang with quotes string causes SCORM to fail

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.5
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Language, SCORM
    • Labels:
    • Environment:
      Linux Apache MySQL, Firefox 9 and MS IE 8
    • Testing Instructions:
      Hide

      1- Install French language package.
      2- unable SCORM debugger.
      3- Try to launch a SCORM, you may get the "Unable to find an API adapter" error

      Show
      1- Install French language package. 2- unable SCORM debugger. 3- Try to launch a SCORM, you may get the "Unable to find an API adapter" error
    • Workaround:
      Hide

      Make sure that all strings used in the french (and maybe other languages) SCORM api are well formed to escape any character that can lead to Javascript interpretation errors.
      examnple, Instead of:
      '-->L'activité....'
      Use
      "-->L'activité...."

      Show
      Make sure that all strings used in the french (and maybe other languages) SCORM api are well formed to escape any character that can lead to Javascript interpretation errors. examnple, Instead of: '-->L'activité....' Use "-->L'activité...."
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull Master Branch:
      master_MDL-31397

      Description

      I have got this message error "Unable to find an API adapter" for a while. After looking over it. I found that it is caused by the combination of two situations:

      • The SCORM debugger is enabled (by me).
      • A syntax error in the french SCORM api. (in fact, there's an error of a ['] not escaped in '-->L'activité....'; so it is causing an error of missing [;].

        Gliffy Diagrams

          Activity

          Hide
          Dan Marsden added a comment -

          thanks for the report - assigning to David, our Language Guru.

          Show
          Dan Marsden added a comment - thanks for the report - assigning to David, our Language Guru.
          Hide
          David Mudrak added a comment -

          Does this affect any SCORM package played in French? This definitely is JavaScript issue (as it does not escape characters), not the language issue. I can look at it though, of course.

          Show
          David Mudrak added a comment - Does this affect any SCORM package played in French? This definitely is JavaScript issue (as it does not escape characters), not the language issue. I can look at it though, of course.
          Hide
          Dan Marsden added a comment -

          whoops - assigning back to me - for some reason I thought this was an invalid lang issue!

          Fouzi - any chance you could be more specific? - which lang string causes the issue?

          thanks,

          Show
          Dan Marsden added a comment - whoops - assigning back to me - for some reason I thought this was an invalid lang issue! Fouzi - any chance you could be more specific? - which lang string causes the issue? thanks,
          Hide
          Fouzi Sukhilala added a comment -

          Hi,
          Here's an example of error that I got after enabling SCORM debuging:
          ----------------------------------------------------------------------
          Erreur : missing ; before statement
          Fichier Source : /mod/scorm/api.php?a=14&scoid=932&currentorg=xp_man0_toc1&attempt=1
          Ligne : 636, Colonne : 36
          Code Source :
          logButton.innerHTML = '-->L'historique API est désactivée';
          -----------------------------------------------------------------------
          As You may note, It is possible to correct that like this:
          logButton.innerHTML = "-->L'historique API est désactivée";
          or
          logButton.innerHTML = '-->L\'historique API est désactivée';
          I think the correction should be done on French translation strings.
          Note: It may be not the unique non well formed french string. And maybe such error can occur with other languages.
          Regards

          Show
          Fouzi Sukhilala added a comment - Hi, Here's an example of error that I got after enabling SCORM debuging: ---------------------------------------------------------------------- Erreur : missing ; before statement Fichier Source : /mod/scorm/api.php?a=14&scoid=932&currentorg=xp_man0_toc1&attempt=1 Ligne : 636, Colonne : 36 Code Source : logButton.innerHTML = '-->L'historique API est désactivée'; ----------------------------------------------------------------------- As You may note, It is possible to correct that like this: logButton.innerHTML = "-->L'historique API est désactivée"; or logButton.innerHTML = '-->L\'historique API est désactivée'; I think the correction should be done on French translation strings. Note: It may be not the unique non well formed french string. And maybe such error can occur with other languages. Regards
          Hide
          Dan Marsden added a comment -

          here's a untested patch with a fix.

          Show
          Dan Marsden added a comment - here's a untested patch with a fix.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Dan Marsden added a comment -

          rebased

          Show
          Dan Marsden added a comment - rebased
          Hide
          Sam Hemelryk added a comment -

          Thanks Dan another spot on patch that has been integrated

          Show
          Sam Hemelryk added a comment - Thanks Dan another spot on patch that has been integrated
          Hide
          Ankit Agarwal added a comment -

          Works as expected!
          Thanks

          Show
          Ankit Agarwal added a comment - Works as expected! Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Some changes to Moodle should be milestones in the project by themselves.

          This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks!

          Closing as fixed, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Some changes to Moodle should be milestones in the project by themselves. This is not the case and your fix is not so important, but your collaboration is highly appreciated, thanks! Closing as fixed, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: