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

Add maxlength attribute and/or validation rule for input fields of CBE pages

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1
    • Fix Version/s: 3.1
    • Component/s: Competencies
    • Labels:
    • Testing Instructions:
      Hide
      Competency framework
      1. Create or edit a competency framework. (Site administration ► Competencies ► Competency Frameworks)
      2. Using the browser tools, inspect the Name field.
        • Confirm that there is a maxlength="100" attribute.
      3. Remove the maxlength attribute for the Name field.
      4. Enter/copy-paste a text that is longer than 100 characters.
      5. Tab away/click on another form element.
        • Confirm that a Maximum of 100 characters validation error is displayed.
      6. Disable JS on the browser and click Save changes
        • Confirm that a Maximum of 100 characters validation error is displayed.
      7. Repeat the above steps for the Id number field.
      Competency
      1. Create or edit a competency. (Site administration ► Competencies ► Competency Frameworks ► [Framework name])
      2. Do the above tests for the Name and Id number fields.
      Learning plan template
      1. Create or edit a learning plan template. (Site administration ► Competencies ► Learning plan templates)
      2. Do the above tests for the Name field.
      User learning plan
      1. Create or edit a user learning plan. (Users ► [User name] ► Learning plans)
      2. Do the above tests for the Name field.
      Evidence of prior learning
      1. Create or edit a user's evidence of prior learning. (Users ► [User name] ► Learning plans ► Evidence of prior learning)
      2. Do the above tests for the Name field.
      Show
      Competency framework Create or edit a competency framework. (Site administration ► Competencies ► Competency Frameworks) Using the browser tools, inspect the Name field. Confirm that there is a maxlength="100" attribute. Remove the maxlength attribute for the Name field. Enter/copy-paste a text that is longer than 100 characters. Tab away/click on another form element. Confirm that a Maximum of 100 characters validation error is displayed. Disable JS on the browser and click Save changes Confirm that a Maximum of 100 characters validation error is displayed. Repeat the above steps for the Id number field. Competency Create or edit a competency. (Site administration ► Competencies ► Competency Frameworks ► [Framework name]) Do the above tests for the Name and Id number fields. Learning plan template Create or edit a learning plan template. (Site administration ► Competencies ► Learning plan templates) Do the above tests for the Name field. User learning plan Create or edit a user learning plan. (Users ► [User name] ► Learning plans) Do the above tests for the Name field. Evidence of prior learning Create or edit a user's evidence of prior learning. (Users ► [User name] ► Learning plans ► Evidence of prior learning) Do the above tests for the Name field.
    • Affected Branches:
      MOODLE_31_STABLE
    • Fixed Branches:
      MOODLE_31_STABLE
    • Pull Master Branch:
      MDL-53865-master

      Description

      There is no maxlength attribute nor validation rules for the name text field of CBE-related pages, so entering a value with more than 100 characters, we'll get

      ERROR: value too long for type character varying(100)

      Found this in:

      • Competency framework
      • Competency
      • Learning plan template
      • User learning plan

      In Evidence of prior learning, the name is being truncated to 100 characters.

      Same with ID numbers.

        Attachments

          Activity

            People

            Assignee:
            jpataleta Jun Pataleta
            Reporter:
            jpataleta Jun Pataleta
            Peer reviewer:
            Adrian Greeve
            Integrator:
            David Monllaó
            Tester:
            John Okely
            Participants:
            Component watchers:
            Jean-Philippe Gaudreau, Steve Massicotte, Serge Gauthier, Issam Taboubi, Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Fix Release Date:
              23/May/16