php error upgrading from 2.5 to 2.7.20 (YUI3 error)

php error upgrading from 2.5 to 2.7.20 (YUI3 error)

by David Paige -
Number of replies: 5

I am trying to upgrade an old site which was handed to me for maintenance.  It's running on Moodle 2.5 (Ubu 12.04), and I am trying to get it running on Moodle 3.1 LTS (Rhel 7). 

I migrated the course to Rhel 7, and have it running under Moodle 2.5.  I haven't been able to get the site to work under Moodle 2.7.20, a stepping stone to Moodle 3.1 LTS.

I discovered during this process that there was some custom php code to implement site-specific APIs which won't apply to the greater Moodle community.  It took me a while and many emails to people who are not longer here to understand that this was custom code, non-standard plugins.

The showstopper at this point is this error:  Coding error detected, it must be fixed by a programmer: Missing YUI3 module details.

The specific line from the traceback reads:

   Stack trace: (first two lines below)

   line 786 of /lib/outputrequirementslib.php: coding_exception thrown

   line 269 of /blocks/news/block_news.php: call to page_requirements_manager->js_module ()

   line 295 of /blocks/moodleblock.class.php: call to block_news->get_required_javascript()

I believe that the error is line 269 (shown below):

$this->page->required->js_module('core_dock');

I can't find anything called core_dock.js,  Searching moodle.net has not led me any further down the path towards absolute zen.

How do I fix that particular line?

Average of ratings: -
In reply to David Paige

Re: php error upgrading from 2.5 to 2.7.20 (YUI3 error)

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi David,
this link could be of help: https://moodle.org/mod/forum/discuss.php?d=271728#p1170475.

Indeed, the block "news" is not in the core dist: look at https://github.com/moodle/moodle/tree/MOODLE_27_STABLE/blocks; it looks like an outdated (block) plug-in.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: php error upgrading from 2.5 to 2.7.20 (YUI3 error)

by David Paige -

Thank you for the suggestion.  I won't be able to take a look at it until Monday though.  In my case, contacting the original developer from four years ago isn't an option for me.  Is there a particular location where the javascript would be stored?  It sounds like it's part of the plugin.

In reply to David Paige

Re: php error upgrading from 2.5 to 2.7.20 (YUI3 error)

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi David,
you should share that plug-in here to get a more helpful reply.

BTW, the JS is not there but in past versions of Moodle, now deprecated and the plug-in should use the "new JS", replacing the deprecated one.

HTH,
Matteo

In reply to Matteo Scaramuccia

Re: php error upgrading from 2.5 to 2.7.20 (YUI3 error)

by David Paige -

I will try and figure out how to use the "new JS" call.  There are something like 100 php files scattered through a number of subdirectories, and you're probably not going to want to look through all of that.  I suppose there is a page on Moodle.net which explains how to use the new JS calls?