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

Fix uninitialized variable warning when not using LTI. #2622

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

somiaj
Copy link
Contributor

@somiaj somiaj commented Nov 13, 2024

Check that $ce->{LTIVersion} is defined and not empty before using it. This variable being initialized should ensure that the other LTI variables used here are also initialized.

Check that `$ce->{LTIVersion}` is defined and not empty before using it.
This variable being initialized should ensure that the other LTI variables
used here are also initialized.
Copy link
Member

@drgrice1 drgrice1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I don't know how I missed this when this change was added. Probably the fact that I typically have LTI authentication enabled.

@somiaj
Copy link
Contributor Author

somiaj commented Nov 13, 2024

@drgrice1 Think we can remove the line && defined $ce->{LTIGradeMode}, since if $ce->{LTIVersion} is defined, this not being defined is probably an error?

@drgrice1
Copy link
Member

In theory LTIGradeMode does not need to be defined even if the LTIVersion is. I think that all of the webwork2 code is designed to check that it is defined first. Note that there are many places where it is not directly checked that LTIGradeMode is defined and it is just used and compared to a string, but the code in those regions can only be called if it is defined.

@Alex-Jordan Alex-Jordan merged commit 01a3b27 into openwebwork:develop Nov 13, 2024
2 checks passed
@somiaj somiaj deleted the fix-lti-uninitialized branch November 24, 2024 19:03
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

Successfully merging this pull request may close these issues.

3 participants