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

XMLDB (Mysql) fails to save number (decimal) field with 0 precision (zero decimal places)

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • 4.1.11, 4.4.1
    • Database SQL/XMLDB
    • None
    • MOODLE_401_STABLE, MOODLE_404_STABLE

      I'm trying to define a decimal field with 0/zero decimal places, e.g. 00000001, to store a number with prefixed zeros/0's in MySQL DB. 

      The XMLDB editor interface throws a missingparam (name) error.

      A required parameter (name) was missing
      Debug info:
      Error code: missingparam×Dismiss this notification
      Stack trace: * line 610 of /lib/moodlelib.php: moodle_exception thrown

      • line 114 of /admin/tool/xmldb/actions/edit_table/edit_table.class.php: call to required_param()
      • line 187 of /admin/tool/xmldb/actions/XMLDBAction.class.php: call to edit_table->invoke()
      • line 110 of /admin/tool/xmldb/actions/load_xml_file/load_xml_file.class.php: call to XMLDBAction->launch()
      • line 187 of /admin/tool/xmldb/actions/XMLDBAction.class.php: call to load_xml_file->invoke()
      • line 113 of /admin/tool/xmldb/actions/save_xml_file/save_xml_file.class.php: call to XMLDBAction->launch()
      • line 67 of /Users/richardwhitehead/Sites/MOODLE/moodleplugindev/public_html/admin/tool/xmldb/index.php: call to save_xml_file->invoke()

       

       

      • XMLDB Editor field definition is as follows: 
      • Name: anylowercasestring
      • Comment: blank/any
      • type: number
      • length: 8
      • Decimals: 0/blank (both produce the same error - using positive numbers removes the error, but I don't want decimal places).
      • Not null: not null/null (doesn't affect issue)
      • Sequence: No
      • Default: n/a (have tried 00000001 or blank - doesn't affect issue).

      Same field defined directly in module/db/install.xml:

      <FIELD NAME="decimalcode" TYPE="number" LENGTH="8" NOTNULL="true" DEFAULT="00000001" SEQUENCE="false" DECIMALS="0"/>

      my IDE codesniffer complains: The value '0' of attribute 'DECIMALS' on element 'FIELD' is not valid with respect to its type, 'positiveInteger'. 

            Unassigned Unassigned
            rickwhitehead Rick Whitehead
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.