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

Labels with nothing but tags in them don't work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.2
    • 1.9.1
    • Course
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      To reproduce....

      • Create a label with nothing but an img tag in it.

      The label (ie. the image in this case) will not be displayed and (if you have debugging on) you'll get an error - like this...

      ( ! ) Notice: Undefined index: 2414 in /var/www/moodle/stable19/course/lib.php on line 1344
      Call Stack

      1. Time Memory Function Location
        1 0.0016 125908 {main}

        ( ) ../view.php:0
        2 0.6145 21449208 require( '/var/www/moodle/stable19/course/format/topics/format.php' ) ../view.php:226
        3 0.6979 22013340 print_section( ) ../format.php:130

      Analysis...

      In mod/label/lib.php, the label_update_instance() function strips all the tags from the content to create the label name. If there's nothing but tags, the name is empty and it fails to save it properly.

      My suggestion would be to create an arbitrary name in this case (the word 'label' plus the id or somesuch).

            howardsmiller Howard Miller
            howardsmiller Howard Miller
            Jérôme Mouneyrac Jérôme Mouneyrac
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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