LdesignMedia / moodle-local_commander

Quick navigation - local plugin for Moodle 3.x
https://ldesignmedia.nl
GNU General Public License v3.0
6 stars 2 forks source link

Ajax errors #8

Closed cwarwicker closed 4 years ago

cwarwicker commented 4 years ago

Hi,

I am reviewing your plugin for some clients and have run into some problems.

With full debugging turned on, when the commander popup is brought up, we get the following errors:

https://ibb.co/hX9GzWc

The trace led me to the ajax_check_captured_output function you are calling at the end of ajax.php, which specifically throws an error if developer debugging is on. This isn't a huge issue, bnut would be nice to be able to use the plugin whilst developing.

However, then I turned all debugging off to make sure it worked without it, and instead now we get a Moodle popup saying "js:error_parsing local_commander" and the commander popup doesn't work.

If i comment out the ajax_check_captured_output call at the end and just let it echo the menu content, it works fine with debugging on and off, but I assume you've got that for a reason?

Thanks.


Test Environment: Moodle 3.7

cwarwicker commented 4 years ago

To add onto this, I've just noticed that logged in as a teacher on a course, it works. But logged in as a site admin, is when we get the js:error_parasing popup.

luukverhoeven commented 4 years ago

Hi @cwarwicker,

Thanks for the message. We don't see this issue in 3.7

Can you send the json output from the request /local/commander/ajax.php?courseid=1? I expect that there is an error in the json structure.

The response should be something like this: https://gist.github.com/luukverhoeven/207b13ddc821d572c64f885117ddf882

cwarwicker commented 4 years ago

Hi,

Both on the same course, with debugging turned ON:

[DOES NOT WORK] This is the output as Site Admin: https://pastebin.com/zzkYrdy5 [WORKS] This is the output as Teacher: https://pastebin.com/rYNkgdTC


With debugging turned OFF:

[DOES NOT WORK] As a site admin, that content is simply blank. [WORKS] As a teacher: https://pastebin.com/MA9vjtCs


So it looks like my initial report of it not working with debugging on, isn't accurate. It just appears that it's not working for Site Admins.

luukverhoeven commented 4 years ago

Hi @cwarwicker ,

Can you check if the latest release solves the issues? https://github.com/MFreakNL/moodle-local_commander/releases/tag/3.8.3

cwarwicker commented 4 years ago

Hi, That seems to be okay now. Thanks.