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

Enumeration syntax in XMLDB

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • None
    • 1.7
    • Database SQL/XMLDB
    • None
    • Any
    • MOODLE_17_STABLE

      Enumerations are currently specified by adding ENUM="true" and ENUMVALUE="..."

      This introduces a whole new level of quoting special characters and syntax for specifying values for the enumeration

      Perhaps instead you could specify the values in XML such as ...

      <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" ENUM="true" COMMENT="type of stat">
      <ENUMVALUE>value 1</ENUMVALUE>
      <ENUMVALUE>value 2</ENUMVALUE>
      <ENUMVALUE>value 3</ENUMVALUE>
      </FIELD>

      or

      <FIELD NAME="stattype" TYPE="char" LENGTH="20" NOTNULL="true" DEFAULT="activity" SEQUENCE="false" ENUM="true" COMMENT="type of stat">
      <ENUMVALUE value="value 1" />
      <ENUMVALUE value="value 2" />
      <ENUMVALUE value="value 3" />
      </FIELD>

      This would remove any doubt when trying to insert special characters into an enum field because the user would just write valid XML.

            skodak Petr Skoda
            ned0r Martyn Smith (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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