Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown Menus #44

Open
PoetaGA opened this issue Oct 5, 2020 · 2 comments
Open

Dropdown Menus #44

PoetaGA opened this issue Oct 5, 2020 · 2 comments

Comments

@PoetaGA
Copy link

PoetaGA commented Oct 5, 2020

There is a conflict between the plugin code and Moodle 3.6: when the block is added in the dashboard, none of the dropdown menus will work.

Uncaught Error: Mismatched anonymous define() module: function(){"use strict";var t;function l(){return t.apply(null,arguments)}function e(e){t=e}function r(e){return e instanceof Array||Object.prototype.toString.call(e)==="[object Array]"}function s(e){return e instanceof Date||Object.prototype.toString.call(e)==="[object Date]"}function n(e,t){var n=[],i;for(i=0;i<e.length;++i){n.push(t(e[i],i))}return n}function o(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function a(e,t){for(var n in t){if(o(t,n)){e[n]=t[n]}}if(o(t,"toString")){e.toString=t.toString}if(o(t,"valueOf")){e.valueOf=t.valueOf}return e}function f(e,t,n,i){return Ht(e,t,n,i,true).utc()}function i(){return{empty:false,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:false,invalidMonth:null,invalidFormat:false,userInvalidated:false,iso:false,parsedDateParts:[],meridiem:null}}function d(e){if(e._pf==null){e._pf=i()}return e._pf}var u;if(Array.prototype.some){u=Array.prototype.some}else{u=function(e){var t=Obje…

@tim1mw
Copy link

tim1mw commented Oct 9, 2020

In addition, testing on Moodle 3.9 this crash seems to prevent other content on the page that relies on Ajax calls from working, so it's a bit of a show stopper.

@tim1mw
Copy link

tim1mw commented Oct 13, 2020

The problem is this line in the js/custom.js file:

define(["jquery"],function($) {

It seems to be clashing with something in Moodle core. The purpose of the code within this define block is to set up an event handler for the button that switches the display style of the courses in the block. That can just as easily be done by triggering the code after the page has finished loading, so changing that line to this:

$(document).ready(function($) {

Fixes the problem and doesn't seem to have any side effects (though I have only done minimal testing).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants