From b75d0f0de286891623d3b113fc842b92973c8963 Mon Sep 17 00:00:00 2001 From: Jun Pataleta Date: Wed, 19 Oct 2016 15:37:01 +0800 Subject: [PATCH] MDL-53832 enrol_lti: Update codes to use the new DB field names --- enrol/lti/classes/tool_provider.php | 2 +- enrol/lti/lib.php | 2 +- enrol/lti/tests/lib_test.php | 2 +- enrol/lti/tests/tool_provider_test.php | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/enrol/lti/classes/tool_provider.php b/enrol/lti/classes/tool_provider.php index 1a133d110c2ce..0ceec89b6d577 100644 --- a/enrol/lti/classes/tool_provider.php +++ b/enrol/lti/classes/tool_provider.php @@ -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) { diff --git a/enrol/lti/lib.php b/enrol/lti/lib.php index 3732252b406a5..1377b19781527 100644 --- a/enrol/lti/lib.php +++ b/enrol/lti/lib.php @@ -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(); diff --git a/enrol/lti/tests/lib_test.php b/enrol/lti/tests/lib_test.php index 4c8e5be986086..823be1a444ddf 100644 --- a/enrol/lti/tests/lib_test.php +++ b/enrol/lti/tests/lib_test.php @@ -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. diff --git a/enrol/lti/tests/tool_provider_test.php b/enrol/lti/tests/tool_provider_test.php index 20dd425100485..64f3354efa359 100644 --- a/enrol/lti/tests/tool_provider_test.php +++ b/enrol/lti/tests/tool_provider_test.php @@ -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)); } @@ -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)); }