Skip to content

Commit

Permalink
MDL-53832 enrol_lti: Update codes to use the new DB field names
Browse files Browse the repository at this point in the history
  • Loading branch information
junpataleta committed Oct 19, 2016
1 parent fa015ab commit b75d0f0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion enrol/lti/classes/tool_provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ public function map_tool_to_consumer() {
// Map the consumer to the tool.
$mappingparams = [
'toolid' => $this->tool->id,
'consumer_pk' => $this->consumer->getRecordId()
'consumerid' => $this->consumer->getRecordId()
];
$mappingexists = $DB->record_exists('enrol_lti_tool_consumer_map', $mappingparams);
if (!$mappingexists) {
Expand Down
2 changes: 1 addition & 1 deletion enrol/lti/lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public function delete_instance($instance) {
$dataconnector = new data_connector();
foreach ($rsmapping as $mapping) {
$consumer = new ToolConsumer(null, $dataconnector);
$consumer->setRecordId($mapping->consumer_pk);
$consumer->setRecordId($mapping->consumerid);
$dataconnector->deleteToolConsumer($consumer);
}
$rsmapping->close();
Expand Down
2 changes: 1 addition & 1 deletion enrol/lti/tests/lib_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function test_delete_instance() {

$mappingparams = [
'toolid' => $tool->id,
'consumer_pk' => $tp->consumer->getRecordId()
'consumerid' => $tp->consumer->getRecordId()
];

// Check first that the related records exist.
Expand Down
4 changes: 2 additions & 2 deletions enrol/lti/tests/tool_provider_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function test_on_register() {
// Check published tool and tool consumer mapping.
$mappingparams = [
'toolid' => $tool->id,
'consumer_pk' => $tp->consumer->getRecordId()
'consumerid' => $tp->consumer->getRecordId()
];
$this->assertTrue($DB->record_exists('enrol_lti_tool_consumer_map', $mappingparams));
}
Expand Down Expand Up @@ -506,7 +506,7 @@ public function test_map_tool_to_consumer() {
// Check published tool and tool consumer mapping.
$mappingparams = [
'toolid' => $this->tool->id,
'consumer_pk' => $tp->consumer->getRecordId()
'consumerid' => $tp->consumer->getRecordId()
];
$this->assertTrue($DB->record_exists('enrol_lti_tool_consumer_map', $mappingparams));
}
Expand Down

0 comments on commit b75d0f0

Please sign in to comment.