justinhunt / moodle-filter_poodll

The PoodLL Filter
6 stars 17 forks source link

JS Whiteboards not loading in moodle 2.9 #12

Closed mpetrowi closed 7 years ago

mpetrowi commented 8 years ago

If I'm reading the release right, whiteboards are now supported in moodle 2.9. However, we are seeing the javascript error: "Uncaught Error: No define call for filter_poodll/react-with-addons" and the whiteboards fail to load.

This is in moodle 2.9.4 and the latest poodll from git (29+ BRANCH).

mpetrowi commented 8 years ago

I apologize for the double-post on the moodle plugins page.

justinhunt commented 8 years ago

No worries about the double post. At triple posts it starts to get serious. There is something going on here, because it does seem to be broken. I will have to put in a Moodle 2.9.1 to test this, but the odd thing is that it is working on Moodle 3. I just can't promise when I will look at this. But I will try to do so over the next week

mpetrowi commented 8 years ago

Hi Justin, I found the problem with moodle 2.9 -- There is no dependency from filter_poodll/literallycanvas to filter_poodll/react_amd. On moodle 3, react_amd happens to load first and everything works. On moodle 2.9, literallycanvas loads first and it dies.

At the top of literallycanvas.min.js, replacing define(t) with define(['filter_poodll/react_amd'],t) makes it work. Unfortunately this is changing the upstream source. Is there a better way?

justinhunt commented 8 years ago

Interesting. LiterallyCanvas is not really there with AMD yet, although the developer did do some work on it. So I changed it a bit to work. I think its ok to hack it up a bit more. In fact I would like to do it properly, but if this works great. I worry that it will break working Moodle 3 sites. But let me test it and report back. If its ok I will add the changes.

Thanks

On Wed, Mar 2, 2016 at 3:57 AM, Matt Petro notifications@github.com wrote:

Hi Justin, I found the problem with moodle 2.9 -- There is no dependency from filter_poodll/literallycanvas to filter_poodll/react_amd. On moodle 3, react_amd happens to load first and everything works. On moodle 2.9, literallycanvas loads first and it dies.

At the top of literallycanvas.min.js, replacing define(t) with define(['filter_poodll/react_amd'],t) makes it work. Unfortunately this is changing the upstream source. Is there a better way?

— Reply to this email directly or view it on GitHub https://github.com/justinhunt/moodle-filter_poodll/issues/12#issuecomment-190851806 .

mpetrowi commented 8 years ago

In that case, I think adding the dependency is the right way to go, assuming it doesn't break on Moodle 3.

One other thing, please add the amd/src version of all the javascript files. If "cache javascript" is turned off, moodle will use those and fail to load, not to mention making debugging easier. Thanks.

justinhunt commented 7 years ago

I am going to close this now because the whiteboards are all fully amd compatible in PoodLL3. Your point about the amd/src files not being available is still an issue however (sorry!)