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

Labels with nothing but tags in them don't work

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.9.1
    • 1.9.2
    • Course
    • None
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

    Description

      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).

      Attachments

        Issue Links

          Activity

            People

              howardsmiller Howard Miller
              howardsmiller Howard Miller
              Jérôme Mouneyrac Jérôme Mouneyrac
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Laurent David, Raquel Ortega, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                11/Jul/08