instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.58k stars 2.48k forks source link

Deeplinking fails with LTI 1.1 tools when the content returned by the tool doesn't include a title #2142

Closed marcospri closed 1 year ago

marcospri commented 1 year ago

Summary:

Deeplinking fails with LTI 1.1 tools when the content returned by the tool doesn't include a title

Steps to reproduce:

  1. Select a LIT 1.1 external tool and finish the tool's deep linking process returning a valid response with no title.

  2. The following error is reported in the browser console:

helpers.js:89 Uncaught TypeError: Cannot read properties of undefined (reading 'name')
    at G.handleContentItemResult (select_content_dialog.js:191:61)
    at G.externalContentReadyHandler (select_content_dialog.js:59:25)
    at G.ltiPostMessageHandler (select_content_dialog.js:142:27)
    at a (helpers.js:73:23)
  1. The "Link Resource from External tool" gets stuck with the message "Success! This popup should close on its own..."

Expected behavior:

The deep linking process should finish successfully. It does in LTI 1.3 version of the tool.

Actual behavior:

The content selection process fails.

Additional notes:

In the LTI1.1 version tool is undefined here, provoking the error:

https://github.com/instructure/canvas-lms/blob/f18139732c8d38b76968a064403ddf8b2c9fdd0e/ui/shared/select-content-dialog/jquery/select_content_dialog.js#L191

xandroxygen commented 1 year ago

Thank you for the excellent and timely bug report!! A fix will be merged and deployed within the next hour.

xandroxygen commented 1 year ago

this fix has been deployed to all hosted Canvas instances as of last night