Moodle
  1. Moodle
  2. MDL-36142

loadSCO.php launched over parent folders returns an 'hidden' HTTP 404 error

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: SCORM
    • Labels:
    • Testing Instructions:
      Hide
      1. (Opt) Create an empty course
      2. Add a new SCORM/AICC activity using e.g. the SCORM 1.2 package attached in MDL-35840, MDL-35840.zip
      3. Open a network traffic sniffer or Firebug
      4. Launch the Activity and navigate through the TOC even into the items representing a folder by using the navigation buttons: clicking directly on those items will just collapse/expand them!
      5. Look for any HTTP 404 error

      Please, note that applying MDL-35840 into the master branch will prevent calling items without content, as it is supposed to be.

      Show
      (Opt) Create an empty course Add a new SCORM/AICC activity using e.g. the SCORM 1.2 package attached in MDL-35840 , MDL-35840 .zip Open a network traffic sniffer or Firebug Launch the Activity and navigate through the TOC even into the items representing a folder by using the navigation buttons: clicking directly on those items will just collapse/expand them! Look for any HTTP 404 error Please, note that applying MDL-35840 into the master branch will prevent calling items without content, as it is supposed to be.
    • Workaround:
      Hide

      There's no workaround but it is supposed that this error doesn't actually affect final users but the logs of the web server. It cannot be easily seen - out of a dev environment - due to the hidden HTTP 404 errors: testing MDL-35840 brings the attention back.

      Show
      There's no workaround but it is supposed that this error doesn't actually affect final users but the logs of the web server. It cannot be easily seen - out of a dev environment - due to the hidden HTTP 404 errors: testing MDL-35840 brings the attention back.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      m24_MDL-36142_Incorrect_query_returns_HTTP_404
    • Rank:
      44914

      Description

      When $sco->launch = '' a SQL exception is triggered:

      Debug info: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'scorm_scoes', 'launch', false, true).' AND id > '179' ORDER BY id ASC' at line 1
      SELECT * FROM mdl_scorm_scoes WHERE scorm = ? AND '.('scorm_scoes', 'launch', false, true).' AND id > ? ORDER BY id ASC
      [array (
      0 => '7',
      1 => '179',
      )]
      Error code: dmlreadexception
      Stack trace:
      
          line 407 of /lib/dml/moodle_database.php: dml_read_exception thrown
          line 1014 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
          line 1189 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_records_sql()
          line 82 of /mod/scorm/loadSCO.php: call to moodle_database->get_records_select()
      

      This issue has seen the light starting from MDL-35418 due to the fact that when attending a Learning Package it tries to deliver those items of the TOC being just a folder (no manifest//resource@href i.e. $sco->launch = ''): sniffing the traffic between client and server will show these HTTP 404 errors, on GETting mod/scorm/loadSCO.php?a=<activity_id>&scoid=<sco_id_being_an_item_not_launch-able>&currentorg=&attempt=<attempt_id>.

        Issue Links

          Activity

          Hide
          Dan Marsden added a comment -

          looks good to me - thanks Matteo

          Show
          Dan Marsden added a comment - looks good to me - thanks Matteo
          Hide
          Dan Poltawski 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
          Dan Poltawski 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 Poltawski added a comment -

          Integrated, thanks guys

          Show
          Dan Poltawski added a comment - Integrated, thanks guys
          Hide
          Dan Poltawski added a comment -

          OH, just to confirm this doesn't need to backported??

          Show
          Dan Poltawski added a comment - OH, just to confirm this doesn't need to backported??
          Hide
          Dan Marsden added a comment -

          yeah - no backport this is master only code - sorry for not mentioned that in the comments!

          Show
          Dan Marsden added a comment - yeah - no backport this is master only code - sorry for not mentioned that in the comments!
          Hide
          Michael de Raadt added a comment -

          Test result: Success!

          Tested in master only.

          Show
          Michael de Raadt added a comment - Test result: Success! Tested in master only.
          Hide
          Dan Poltawski added a comment -

          Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week!

          ciao
          Dan

          Show
          Dan Poltawski added a comment - Congratulations! Another bug solved.. only another 7330 to go, thanks for contributing to contributing to 0.8% of all bugs being fixed this week! ciao Dan

            People

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

              Dates

              • Created:
                Updated:
                Resolved: