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

Current xmldb_dbg() shows some problems...

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 1.8
    • Fix Version/s: 1.8
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Environment:
      Any, Moodle 1.8
    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE

      Description

      Current implementation of xmldb_dbg() has some drawbacks.

      First of all, it's used directly by XMLDB objects, and that creates one dependency from such XMLDB pure objects to one function outside them. This must be avoided.

      More yet, in the XMLDB editor we don't use ddllib at all (it isn't included nor required) and current location for the xmldb_dbg() function is exactly that (ddllib.php). It works is the standard install/upgrade process (because there such function is included) but not in the editor.

      So, this is the plan I'm going to implement right now:

      • Create one debug($message) function inside the XMLDBObject class (the root one).
      • Implement one hook in the function so, if the 'xmldb_debug' debug function is found anywhere, call it.
      • Create the new 'xmldb_debug' function in datalib.php. It will perform one simple error_log() call
      • Change all the current xmldb_dbg() uses to $this-> xmldb_debug
      • Drop xmldb_dbg() from ddllib.php

      Going....

      P.S.: All this is because, since 2 days ago, main install.xml file in broken in HEAD and the editor is unusable. My initial thoughts were about to simply require_once(ddllib.php) in code, but I think the solution above is cleaner an maintains the independency of the editor.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              stronk7 Eloy Lafuente (stronk7)
              Reporter:
              stronk7 Eloy Lafuente (stronk7)
              Tester:
              Nobody
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                31/Mar/07