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

module names should not allow names to be entered beyond 255 characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • 2.3.7, 2.4.4
    • 2.4.3
    • Course
    • MOODLE_24_STABLE
    • MOODLE_23_STABLE, MOODLE_24_STABLE
    • MDL-39422-master
    • Hide

      Sample text [STRING-A]
      "This is a really really really long string which you would think would never ever be used but in actual fact is longer than moodle supports in some fields. Rather than accept this string we should stop it, as its over 255 characters in length, its nearly 260"

      1. Go to a new course as teacher
      2. Using the inline editing button (pencil icon), try to change the title of the news forum to the STRING-A
      3. VERIFY: it won't accept the whole string.
      4. VERIFY: the shortened string is saved without db error
      5. FOR EVERY activity/resource EXCEPT forum, workshop & label
      6. Set the name as the STRING-A
      7. VERIFY: the string is not accepted, with a warning about the length of the string
      8. VERIFY: a shortened string is accepted
      Show
      Sample text [STRING-A] "This is a really really really long string which you would think would never ever be used but in actual fact is longer than moodle supports in some fields. Rather than accept this string we should stop it, as its over 255 characters in length, its nearly 260" Go to a new course as teacher Using the inline editing button (pencil icon), try to change the title of the news forum to the STRING-A VERIFY: it won't accept the whole string. VERIFY: the shortened string is saved without db error FOR EVERY activity/resource EXCEPT forum, workshop & label Set the name as the STRING-A VERIFY: the string is not accepted, with a warning about the length of the string VERIFY: a shortened string is accepted

      At our University there are some lecturer who add resources with Names longer than 255 chars.
      The URL is: https://mymoodle..../course/modedit.php?add=resource&type=&course=123&section=1&return=0&sr=0

      Now my request is: Is it possible to change <input size="48" name="name" type="text" onblur="validate_mod_resource_mod_form_name(this)" onchange="validate_mod_resource_mod_form_name(this)" id="id_name">

      to something like

      <input size="48" maxlengt="255" name="name" type="text" onblur="validate_mod_resource_mod_form_name(this)" onchange="validate_mod_resource_mod_form_name(this)" id="id_name">

      If the names length is longer as 255 chars thereĀ“s follogwing error shown:

      Debug info: ERROR: value too long for type character varying(255)
      INSERT INTO mdl_resource (name,display,filterfiles,course,revision,intro,introformat,timemodified,displayoptions) VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9) RETURNING id
      [array (
      'name' => 'bjjbjdsbvjdsbvjdsbvjdsbvjkdsbvjdvbsdkvbdjsvbjdvbsdjvbjsdbvjkdbvjdsbvjdsbvkjsdbvjdsbvksjdbvsdkvbjdsbvjdsvbjssdvjdsvjsdbvjdsbvsbbdjvbjsdbvjbdsjvbdsjbvkdsdjvbdjsbdjsbdvkbjvjskjdbvjksdjbvksdvdjsbkjbjvjsbkdjbvjskjdbjvsjkjdbvsjdkjbvvvvvvvvvvvvvvvvvvvvvjddddddddddddddddddddddddddddddddddddddddddddddskkkkkkkkkkkkkkkkkkkkkkkkskskskskskskskksskkkskdbjdbcbscdbscjbcjksbcsdjbckjbcksdcbjdcbkjsbdjbcksjbdcksdjbcksjbcjdksjdbcjskdjbcjbsjdbcskcbkjbkjsbcjcbsjcbsjcbkjcbsdckjbscjbscsjb',
      'display' => '5',
      'filterfiles' => '0',
      'course' => '648',
      'revision' => 1,
      'intro' => '',
      'introformat' => '1',
      'timemodified' => 1367309963,
      'displayoptions' => 'a:2:

      {s:8:"showsize";i:1;s:8:"showtype";i:1;}

      ',
      )]
      Error code: dmlwriteexception
      Stack trace:
      line 429 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 248 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 857 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 909 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->insert_record_raw()
      line 97 of /mod/resource/lib.php: call to pgsql_native_moodle_database->insert_record()
      line 449 of /course/modedit.php: call to resource_add_instance()

      Thanks,
      Benjamin Droemer
      Ulm University

            poltawski Dan Poltawski
            beni_x91 Benjamin Droemer
            Sam Hemelryk Sam Hemelryk
            Andrew Davis Andrew Davis
            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.