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

XMLDB check defaults returns false warnings

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.4.4, 3.5.1, 3.6.4, 3.7
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Affected Branches:
      MOODLE_34_STABLE, MOODLE_35_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE

      Description

      Hi,

      When we use tool "Site administration / Development / XMLDB editor / Check Defaults" , it returns false warnings with some integer values.

      Sample :

      • Table: question. Field: defaultmark, Expected '1' Actual '1.0000000'
      • Table: question_answers. Field: fraction, Expected '0' Actual '0.0000000'
      • Table: question_attempts. Field: maxfraction, Expected '1' Actual '1.0000000'
      • Table: grade_items. Field: grademax, Expected '100' Actual '100.00000'
      • .....

      This problem is not present in an old version of Moodle (3.1.5)

      After searching in source, I found a difference in file
      $WWWROOT/admin/tool/xmldb/actions/check_defaults/check_defaults.class.php (line 97)

      In Moodle 3.5 , the test is : 

      if ($physicaldefault !== $xmldbdefault) {

      In Moodle 3.1 it was:

      if ($physicaldefault != $xmldbdefault) {

      I suppose that the problem comes from the test
      " != " tests only the value , " !== " tests the value and type

       

      I try to change " !== " to " != " in my Moodle 3.5 and get no warnings

      Thanks a lot

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: