-
-
Notifications
You must be signed in to change notification settings - Fork 967
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
base: master
Are you sure you want to change the base?
Conversation
if (external_id == null) { | ||
return null; | ||
} | ||
String[] parts = external_id.split(ID_SEPARATOR_REGEX); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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); |
There was a problem hiding this comment.
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.
There was a problem hiding this 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.
No description provided.