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

Labels with nothing but tags in them don't work

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 1.9.2
    • Component/s: Course
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      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

              • Assignee:
                howardsmiller Howard Miller
                Reporter:
                howardsmiller Howard Miller
                Tester:
                Jérôme Mouneyrac
                Participants:
                Component watchers:
                Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  11/Jul/08