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

$OUTPUT->link_to_popup is screwy

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0
    • 2.0
    • Libraries
    • None
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE

    Description

      If you give a link_to_popup an $image, but leave $link->text empty, it throws an exception in $link->prepare(), even though it is about to put the image HTML into $link->text.

      I am about to commit a fix for that by reordering the code, but I am not sure it is right. Please can you review it. Thanks.

      Also, looking at the code for link_to_popup, there are several things that concern me:

      1. Why does it overwrite the $image->title you passed if $image->alt is empty?
      2. $link->linktext is not defined in the html_link class, but it is used here.
      3. The body of the if (!empty($link->linktext)) { looks screwy. I don't understand it, so you either have a bug or a missing comment.

      Attachments

        Activity

          People

            nicolasconnault Nicolas Connault
            timhunt Tim Hunt
            Nobody Nobody
            Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              24/Nov/10