Skip to content

Commit

Permalink
fix resourse link context value
Browse files Browse the repository at this point in the history
  • Loading branch information
firaga committed Dec 11, 2020
1 parent ded10fc commit a33132f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ToolProvider/ToolProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -994,9 +994,6 @@ private function authenticate()
$contentItemId = $_POST['custom_content_item_id'];
}
$this->resourceLink = ResourceLink::fromConsumer($this->consumer, trim($_POST['resource_link_id']), $contentItemId);
if (!empty($this->context)) {
$this->resourceLink->setContextId($this->context->getRecordId());
}
$title = '';
if (isset($_POST['resource_link_title'])) {
$title = trim($_POST['resource_link_title']);
Expand Down Expand Up @@ -1145,6 +1142,9 @@ private function authenticate()
$this->context->save();
}
if ($this->ok && isset($this->resourceLink)) {
if (!empty($this->context)) {
$this->resourceLink->setContextId($this->context->getRecordId());
}

// Check if a share arrangement is in place for this resource link
$this->ok = $this->checkForShare();
Expand Down

0 comments on commit a33132f

Please sign in to comment.