fixed issues with Moodle 3.11 compatibility

This commit is contained in:
PMKuipers 2024-03-25 23:42:40 +01:00
parent d225d82038
commit 88744c2b66
7 changed files with 46 additions and 5 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -12,6 +12,21 @@ import {replaceNodeContents} from 'core/templates';
//import {markFormSubmitted} from 'core_form/changechecker'; // Moodle 4.00+ only
//import {notifyFormSubmittedByJavascript} from 'core_form/events'; // Moodle 4.00+ only
/* Moodle 3.11 safe import for when needed
let markFormSubmitted = () => {};
let notifyFormSubmittedByJavascript = () => {};
import('core_form/changechecker').then((ns) => {
debug.info(ns);
if(ns.markFormSubmitted) {
markFormSubmitted = ns.markFormSubmitted;
}
if(ns.notifyFormSubmittedByJavascript) {
notifyFormSubmittedByJavascript = ns.notifyFormSubmittedByJavascript;
}
}).catch(()=>{});
*/
export default {
install(Vue/*,options*/){

View File

@ -9,7 +9,8 @@
import {get_string,get_strings} from 'core/str';
import {call} from 'core/ajax';
import notification from 'core/notification';
import {resetAllFormDirtyStates} from 'core_form/changechecker';
//import {resetAllFormDirtyStates} from 'core_form/changechecker'; // Moodle 4.00+ only
import Vue from './vue/vue';
@ -36,6 +37,16 @@ Vue.use(BootstrapVue);
const debug = new Debugger("treestudyplan");
let resetAllFormDirtyStates = () => {};
import('core_form/changechecker').then((ns) => {
debug.info(ns);
if(ns.resetAllFormDirtyStates) {
resetAllFormDirtyStates = ns.resetAllFormDirtyStates;
}
}).catch(()=>{});
let strings = load_strings({
studyplan: {
studyplan_select_placeholder: 'studyplan_select_placeholder',

View File

@ -14,6 +14,21 @@ import Debugger from './debugger';
//import {markFormSubmitted} from 'core_form/changechecker'; // Moodle 4.00+ only
//import {notifyFormSubmittedByJavascript} from 'core_form/events'; // Moodle 4.00+ only
/* Moodle 3.11 safe import for when needed
let markFormSubmitted = () => {};
let notifyFormSubmittedByJavascript = () => {};
import('core_form/changechecker').then((ns) => {
debug.info(ns);
if(ns.markFormSubmitted) {
markFormSubmitted = ns.markFormSubmitted;
}
if(ns.notifyFormSubmittedByJavascript) {
notifyFormSubmittedByJavascript = ns.notifyFormSubmittedByJavascript;
}
}).catch(()=>{});
*/
/**
* Create a random UUID in both secure and insecure contexts
* @returns UUID