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

Fixing LTI favicon issue

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 4.0
    • Fix Version/s: None
    • Component/s: LTI provider
    • Labels:
    • Affected Branches:
      MOODLE_400_STABLE

      Description

      I recently ran into the issue described here and in more detail here. In summary, due to a documentation mistake most themes don't implement the favicon method correctly, returning a string instead of a moodle_url. This is usually fine, but may break LTI integration.

      While the documentation has been fixed in the above mentioned issue and everyone agrees that that the themes should be fixed, the reality is that dozens of themes to this day have not been fixed and maybe never will be while otherwise working perfectly fine. For those who need it, LTI is broken and the only workaround is to remove your site's icon, which is not ideal.

      My suggestion is to change the LTI get_icon function to

      public static function get_icon($tool) {
          global $OUTPUT;
          $ret = $OUTPUT->favicon();
          if (is_string($ret)) {
              $ret = new moodle_url($ret);
          }
          return $ret;
      }
      

      ("use moodle_url;" has to be added at the top of the file as well).

      The fix works perfectly fine for me. I can provide a PR, but wanted to hear first if this solution would be considered at all?

      Best regards,

      Mana

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Managarm Nikolas Dahn
            Participants:
            Component watchers:
            Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: