Marking checklist item displays an alert box

Marking checklist item displays an alert box

by Frederic Nevers -
Number of replies: 4

Hi, 

In the checklist module (mod_checklist), when a student or a teacher marks an item as 'complete', an alert popup box with the text 'OK' shows up on the user's screen (see attached). I have tried with several themes, including the bog standard 'clean' and the same problem occurs. Can anyone please point me to the right direction to make it stop? 

Moodle 3.0.5, mod_checklist version 2016052000

Cheers, 

Fred

Average of ratings: -
In reply to Frederic Nevers

Re: Marking checklist item displays an alert box

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That's certainly not something I'd expect my plugin to do - pop-up messages like that should only occur if there is some sort of error to report, not when everything is working.

Could you take a look at the 'network' tab of your browser's developer tools and post here the contents of the reply to the message sent to the server when you tick items in the checklist?

In reply to Davo Smith

Re: Marking checklist item displays an alert box

by Frederic Nevers -

Hi Davo, 

Thanks for your reply and pointer, much appreciated. Here is the data that gets sent to the server (updatechecks.php POST, 200 response):

  • items[158]:"0"
  • sesskey:"somesesskey"
  • id:"27905"

The response from the server is 'OK'

Could this be linked with my issue? (it's from updatechecks24.js)

// Send message to server
                    if (!unload) {
                        callback = {
                            success: function (o) {
                                self.hide_spinner();
                                if (o.responseText !== 'OK') {
                                    window.alert(o.responseText);
                                }
                            },
                            failure: function (o) {
                                self.hide_spinner();
                                window.alert(o.statusText);
                            },
If it makes a difference, our Moodle site in on HTTPS only. Do you have any other pointers to help me solve this issue?

Cheers, 

Fred


In reply to Frederic Nevers

Re: Marking checklist item displays an alert box

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

That looks like the code that would trigger a pop-up, if the response was not just 'OK'. The most likely explanation, is that one of the plugins on your site is introducing an extra space into the output on every page, which is confusing the JavaScript. This can be hard to track down, but may involve a plugin file that starts with a space before the opening <?PHP tag or which contains a closing ?> tag, followed by a space or new line.

I have a command-line script that can help to find such things, but I'm away from my main computer right now so can't attach it.

Average of ratings: Useful (1)
In reply to Davo Smith

Re: Marking checklist item displays an alert box

by Frederic Nevers -

Hi Davo, 

Thank you, you have helped me find and fix the problem. There is a 'local' plugin in our install that had a leading whitespace in one of its files. I have removed it and all is well now. The plugin is a custom one, not available in the Moodle.org plugins database. I will get in touch with the provider to inform them, as other Moodle users may be affected (those who use PowerSchool as their SIS). 

Cheers, 

Fred