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

A "label" title longer than 255 characters throws an exception

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 4.3.8, 4.4.4
    • 4.4.1
    • Resource
    • MOODLE_404_STABLE
    • MOODLE_403_STABLE, MOODLE_404_STABLE
    • MDL-82581-403
    • MDL-82581-404
    • Hide
      1. Log in as admin
      2. Create a course
      3. Add a Text and media activity to the course
      4. Set Name to the following:

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor me
        

      5. Confirm the text cuts off at 255 characters:

        Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor 
        

      6. Save
      7. Confirm there is no Error writing to database exception
      8. Confirm label was created successfully
      Show
      Log in as admin Create a course Add a Text and media activity to the course Set Name to the following: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor me Confirm the text cuts off at 255 characters: Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor Save Confirm there is no Error writing to database exception Confirm label was created successfully

      I'm opening this one in the name of quite a few MoodleCloud users.

      Recipe:

      1. create (or update) a Label ("Text and media area"), using a title longer than 255 characters
      2. save
      3. see the "Error writing to database" message
      4. click on "More information about this error", land on the link to dmlwriteexception and be slightly more confused
      5. click back twice and see you've lost the (long) content of the form you submitted previously

      A warning, before submitting the form about the title being too long would be very appreciated. This is already done in other modules (page, book, ...).

      While testing this, I found out that strangely, the course edit page silently cuts the input at the max length, but does not give a warning about it, but that would be a different issue.

            pholden Paul Holden
            scyrma Mathieu Petit-Clair
            Daniel Ziegenberg Daniel Ziegenberg
            Jun Pataleta Jun Pataleta
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            11 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 1 hour, 29 minutes
                1h 29m

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