Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XBlock rendering breaks when using an non-existent external configuration #420

Open
Agrendalath opened this issue Oct 23, 2023 · 2 comments

Comments

@Agrendalath
Copy link
Member

Steps to reproduce

  1. Go to Studio and create a new LTI Consumer XBlock.
  2. Set the Configuration Type to Reusable Configuration.
  3. Provide a random LTI Reusable Configuration ID.

What happens

The XBlock break with Error: (1048, "Column 'version' cannot be null"). The relevant part of the traceback is:

File "/edx/shared-src/xblock-lti-consumer/lti_consumer/lti_xblock.py", line 1177, in author_view
  return self.student_view(context)
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/lti_xblock.py", line 1227, in student_view
  context.update(self._get_context_for_template())
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/lti_xblock.py", line 1730, in _get_context_for_template
  lti_consumer = self._get_lti_consumer()
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/lti_xblock.py", line 1128, in _get_lti_consumer
  return get_lti_consumer(config_id_for_block(self))
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/api.py", line 96, in config_id_for_block
  config = _get_lti_config_for_block(block)
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/api.py", line 76, in _get_lti_config_for_block
  lti_config = _get_or_create_local_lti_config(
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/api.py", line 46, in _get_or_create_local_lti_config
  lti_config.save()
File "/edx/shared-src/xblock-lti-consumer/lti_consumer/models.py", line 313, in save
  super().save(*args, **kwargs)

What should happen?

The XBlock should display an error about an invalid external configuration ID.

Note: Ensure that students (i.e., users without staff permissions) cannot see this error in LMS.

Originally posted by @Agrendalath in #390 (comment)

@kuipumu
Copy link
Contributor

kuipumu commented Oct 25, 2023

@Agrendalath I created a PR for a possible fix for this issue: #423

@Agrendalath
Copy link
Member Author

Thanks, @kuipumu! I won't be able to test it this week, but I can do this in the next one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants