-
Improvement
-
Resolution: Won't Do
-
Minor
-
None
-
2.8.1
-
MOODLE_28_STABLE
This was suggested by skodak while we were talking about MDL-48210. Currently, every time we call plugin manager's get_plugins(), it automatically loads available updates to the tree of plugins (unless this feature is disabled). But we do not need that information for most of the time, only at dedicated admin pages.
The plan is to move the following part
if (empty($CFG->disableupdatenotifications) and !during_initial_install()) {
|
// Append the information about available updates provided by {@link \core\update\checker()}.
|
$provider = \core\update\checker::instance();
|
foreach ($plugins as $plugininfoholder) {
|
$plugininfoholder->check_available_updates($provider);
|
}
|
}
|
from the method core_plugin_manager::get_plugins_of_type() into the method \core\plugininfo\base::available_updates() that would call $this->check_available_updates() only if the property $this->availableupdates is not set yet, setting it to either array of \core\update\info objects, or false. The property will become protected (the current code relying on it would be changed to use methods). We may want new \core\plugininfo\base::has_available_updates() too.
The suggested change seems to make the code more reliable. It is supposed to save some processing and at least one DB query by loading available updates info only when needed.
- Discovered while testing
-
MDL-48210 Update notification for additional plugins doesn't work anymore
-
- Closed
-