Skip to content

SAK-51078 LTI13 Fix UpdateLineItem API call losing resourceLinkId #13625

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

csev
Copy link
Contributor

@csev csev commented Apr 18, 2025

No description provided.

@csev csev requested a review from hornersa April 18, 2025 19:54
@csev csev marked this pull request as draft April 18, 2025 19:54
if (external_id == null) {
return null;
}
String[] parts = external_id.split(ID_SEPARATOR_REGEX);
Copy link
Contributor

@hornersa hornersa Apr 23, 2025

Choose a reason for hiding this comment

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

Suggested change
String[] parts = external_id.split(ID_SEPARATOR_REGEX);
String[] parts = StringUtils.split(external_id, ID_SEPARATOR_REGEX);

return null;
}
String[] parts = external_id.split(ID_SEPARATOR_REGEX);
return (parts.length < 2) ? null : Long.valueOf(parts[1]);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return (parts.length < 2) ? null : Long.valueOf(parts[1]);
return (parts == null || parts.length < 2) ? null : Long.valueOf(parts[1]);

String[] parts = external_id.split(ID_SEPARATOR_REGEX);
if ( parts.length < 1 || ! parts[0].equals(tool_id.toString()) ) continue;

SakaiLineItem item = getLineItem(signed_placement, gbColumn);
if ( parts.length > 1 ) {
if ( parts.length > 1 && ! "0".equals(parts[1]) ) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ( parts.length > 1 && ! "0".equals(parts[1]) ) {
if ( parts.length > 1 && ! StringUtils.equals("0", parts[1]) ) {

@@ -2650,6 +2655,7 @@ public static Object handleGradebookLTI13(Site site, Long tool_id, Map<String,
String title;

log.debug("siteid: {} tool_id: {} lineitem_key: {} userId: {} scoreObj: {}", site.getId(), tool_id, lineitem_key, userId, scoreObj);
System.out.println("content="+content);
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this println intended? If so, I recommend folding the content var into the log.debug line above.

Copy link
Contributor

@hornersa hornersa left a comment

Choose a reason for hiding this comment

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

I've manually backported this PR to my use case in Sakai 23 and it fixed that bug as is. Since attaching the 23.x patch to the jira a while ago, I've modified a few lines to leverage StringUtil method and made another change to further NPE-proof deriveContentIdFromGradebookExternalId. The suggested changes mostly reflect this.

Finally, I'm not sure if my case exercises the changes introduced with SakaiLTIUtil (or SakaiBLTIUtil in 23.x). Otherwise, this looks good to go to me. I'll await your response before committing to "Approve" for my review.

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.

2 participants