Skip to content

Commit

Permalink
fix correct id value, add log
Browse files Browse the repository at this point in the history
  • Loading branch information
Colin McFadden committed May 14, 2024
1 parent dbc3b5a commit 8ed442a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion app/Http/Controllers/LTI13Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
use Packback\Lti1p3\LtiException;
use \App\LTI13ResourceLink;
use \App\Library\LTI13Processor;
use Log;

class LTI13Handler extends Controller
{
Expand Down Expand Up @@ -266,12 +267,15 @@ private function fixResourceDataUsingAGS(Chime $chime, array $resourceData) {
}
$ags = LTI13Processor::getAGS($chime);
$lineItems = $ags->getLineItems();

foreach($lineItems as $lineItem) {
if($lineItem["id"] == $resourceData["id"]) {
if($lineItem["resourceLinkId"] == $resourceData["id"]) {
Log::error("Resource data title was empty, so we're using the line item title", ["resourceData"=>$resourceData, "lineItem"=>$lineItem]);
$resourceData["title"] = $lineItem["label"];
return $resourceData;
}
}
return $resourceData;

}

Expand Down

0 comments on commit 8ed442a

Please sign in to comment.