MDL-62599 lti_gradebookservices: use correct key in get_permitted_scopes
authorJake Dallimore <jake@moodle.com>
Wed, 8 May 2019 01:28:23 +0000 (09:28 +0800)
committerJake Dallimore <jake@moodle.com>
Wed, 8 May 2019 01:28:23 +0000 (09:28 +0800)
This was missing from the revert commit, a464331db2594c, causing scopes
to be empty.

mod/lti/service/gradebookservices/classes/local/service/gradebookservices.php

index 5b88294..2a7c001 100644 (file)
@@ -97,8 +97,8 @@ class gradebookservices extends service_base {
 
         $scopes = array();
         $ok = !empty($this->get_type());
-        if ($ok && isset($this->get_typeconfig()[$this->get_component_id()])) {
-            if (!empty($setting = $this->get_typeconfig()[$this->get_component_id()])) {
+        if ($ok && isset($this->get_typeconfig()['ltiservice_gradesynchronization'])) {
+            if (!empty($setting = $this->get_typeconfig()['ltiservice_gradesynchronization'])) {
                 $scopes[] = self::SCOPE_GRADEBOOKSERVICES_LINEITEM_READ;
                 $scopes[] = self::SCOPE_GRADEBOOKSERVICES_RESULT_READ;
                 $scopes[] = self::SCOPE_GRADEBOOKSERVICES_SCORE;