Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-22340

Include and require bug

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.8
    • Fix Version/s: 1.9.10
    • Component/s: SCORM
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      Hi,

      I've encountered a bug while using a plugin (CICEI Implementation of Conditional Activities).
      When viewing the quiz/view.php page, the plugin checks for rights to see the activity making multiple includes of mod files.
      One of the include was scorm/lib.php, in a function this one includes scorm/locallib.php by calling require_once('locallib.php').
      The problem is that php tries to include quiz/locallib.php and not scorm/locallib.php.
      To prevent this i suggest using the complete path to the include file ( require_once($CFG->dirroot.'/mod/scorm/locallib.php') ).
      I've attached a patch to correct this in all mod/scorm files.

      Valérian

        Attachments

          Activity

            People

            Assignee:
            danmarsden Dan Marsden
            Reporter:
            valerian valerian
            Tester:
            Nobody
            Participants:
            Component watchers:
            Damyon Wiese, Dan Marsden, Matteo Scaramuccia, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              25/Oct/10