The purpose of the class is to fetch the information about available
updates for the Moodle core and/or Moodle components from a remote site
and cache it locally.
We will need to know our major version to fetch the relevant data from remote
servers. This patch also fixes yet another place where the version used
to be hard-coded.
These changes are motivated by feedback from Tim Hunt (17 October 2011
in the developers chat room). The combination of using an interface, but
then putting all the useful information in public fields, was not good
design of this library. So I am merging the plugin_information interface
and the plugintype_base class into a new abstract class plugininfo_base.
This new class defines the basic API of all information holding
subclasses. This does not change the code, just puts the documentation
closer to the methods they are actually implemented.
Classes with magic properties such as context do not pass through json_encode().
The solution is to implement iterator in such classes and convert what we
feed to json_encode to array using 'foreach' before we pass it to json_encode():
- class context implements IteratorAggregate
- added function convert_to_array() that converts anything to array
- before calling json_encode we convert the argument to array
None of these problems affect the default roles. They only occur when
the permissions have been edited to allow restricted subsets of the
question capabilities.
In some cases, things that the restriced subset of capabilities should
have allowed were blocked by errors. In other cases, users were allowed
to do more than they should bave been due to failures to check the
right capabilities in the right places.
For full details, see the bug report.
Two of the bugs were previously reported separately as MDL-26395 and
MDL-27232.
Sadly, this involves a small API change, but I don't believe anyone was
using the argument I had to remove (because we were sometimes passing a
wrong value, and there is not way to compute the right value at that
point in the code.)
Also sadly, the code to compute the context we are importing into is now
rather spaghetti-like, but it works.
This reverts commit 296c0247c6cc9e525721fc92b5a78c7146e6887d, reversing
changes made to 2511b0742a3695298d8216fe9723581c089909d7.
Conflicts:
lib/db/upgrade.php
version.php