File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -132,16 +132,21 @@ public function instance_settings() {
132132 * @throws \dml_exception
133133 */
134134 public function extend_add_instance_form_definition ($ mform ) {
135+ global $ DB ;
135136
136137 $ mform ->addElement ('advcheckbox ' , 'activity ' ,
137138 get_string ('activity ' , 'lifecycletrigger_opencast ' ));
138139 $ mform ->setType ('activity ' , PARAM_BOOL );
139140 $ mform ->addHelpButton ('activity ' , 'activity ' , 'lifecycletrigger_opencast ' );
140141
141142 $ types = lti_filter_get_types (get_site ()->id );
142- $ configuredtools = lti_filter_tool_types ($ types , LTI_TOOL_STATE_CONFIGURED );
143+ $ tools = lti_filter_tool_types ($ types , LTI_TOOL_STATE_ANY );
144+ $ ltiinstances = $ DB ->get_fieldset_sql ('SELECT DISTINCT(typeid) FROM {lti} ' );
143145 $ ltitools = [];
144- foreach ($ configuredtools as $ key => $ tool ) {
146+ foreach ($ tools as $ key => $ tool ) {
147+ if (!array_key_exists ($ tool ->typeid , $ ltiinstances )) {
148+ continue ;
149+ }
145150 $ ltitools [$ key ] = $ tool ->name ." ( " .$ tool ->baseurl .") " ;
146151 }
147152 if ($ ltitools ) {
You can’t perform that action at this time.
0 commit comments