mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 17:06:53 +02:00
Merge branch 'mdl-59562' of https://github.com/Peterburnett/moodle
This commit is contained in:
commit
20a7746b1e
13 changed files with 617 additions and 23 deletions
|
@ -137,7 +137,7 @@ if (!$envstatus) {
|
|||
|
||||
// Test plugin dependencies.
|
||||
$failed = array();
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
|
||||
cli_problem(get_string('pluginscheckfailed', 'admin', array('pluginslist' => implode(', ', array_unique($failed)))));
|
||||
cli_error(get_string('pluginschecktodo', 'admin'));
|
||||
}
|
||||
|
|
|
@ -241,7 +241,7 @@ if (!core_tables_exist()) {
|
|||
|
||||
// check plugin dependencies
|
||||
$failed = array();
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
|
||||
$PAGE->navbar->add(get_string('pluginscheck', 'admin'));
|
||||
$PAGE->set_title($strinstallation);
|
||||
$PAGE->set_heading($strinstallation . ' - Moodle ' . $CFG->target_release);
|
||||
|
@ -508,7 +508,7 @@ if (!$cache and $version > $CFG->version) { // upgrade
|
|||
} else {
|
||||
// Always verify plugin dependencies!
|
||||
$failed = array();
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed)) {
|
||||
if (!core_plugin_manager::instance()->all_plugins_ok($version, $failed, $CFG->branch)) {
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
die();
|
||||
}
|
||||
|
@ -682,7 +682,7 @@ if (!$cache and moodle_needs_upgrading()) {
|
|||
|
||||
// Make sure plugin dependencies are always checked.
|
||||
$failed = array();
|
||||
if (!$pluginman->all_plugins_ok($version, $failed)) {
|
||||
if (!$pluginman->all_plugins_ok($version, $failed, $CFG->branch)) {
|
||||
$output = $PAGE->get_renderer('core', 'admin');
|
||||
echo $output->unsatisfied_dependencies_page($version, $failed, $PAGE->url);
|
||||
die();
|
||||
|
|
|
@ -983,7 +983,7 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
* @return string HTML code
|
||||
*/
|
||||
public function plugins_check_table(core_plugin_manager $pluginman, $version, array $options = array()) {
|
||||
|
||||
global $CFG;
|
||||
$plugininfo = $pluginman->get_plugins();
|
||||
|
||||
if (empty($plugininfo)) {
|
||||
|
@ -1069,8 +1069,10 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
}
|
||||
|
||||
$coredependency = $plugin->is_core_dependency_satisfied($version);
|
||||
$incompatibledependency = $plugin->is_core_compatible_satisfied($CFG->branch);
|
||||
|
||||
$otherpluginsdependencies = $pluginman->are_dependencies_satisfied($plugin->get_other_required_plugins());
|
||||
$dependenciesok = $coredependency && $otherpluginsdependencies;
|
||||
$dependenciesok = $coredependency && $otherpluginsdependencies && $incompatibledependency;
|
||||
|
||||
$statuscode = $plugin->get_status();
|
||||
$row->attributes['class'] .= ' status-' . $statuscode;
|
||||
|
@ -1120,8 +1122,11 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
}
|
||||
|
||||
$status = new html_table_cell($sourcelabel.' '.$status);
|
||||
|
||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
||||
if ($plugin->pluginsupported != null) {
|
||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version, $CFG->branch));
|
||||
} else {
|
||||
$requires = new html_table_cell($this->required_column($plugin, $pluginman, $version));
|
||||
}
|
||||
|
||||
$statusisboring = in_array($statuscode, array(
|
||||
core_plugin_manager::PLUGIN_STATUS_NODB, core_plugin_manager::PLUGIN_STATUS_UPTODATE));
|
||||
|
@ -1452,15 +1457,17 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
* @param \core\plugininfo\base $plugin the plugin we are rendering the row for.
|
||||
* @param core_plugin_manager $pluginman provides data on all the plugins.
|
||||
* @param string $version
|
||||
* @param int $branch the current Moodle branch
|
||||
* @return string HTML code
|
||||
*/
|
||||
protected function required_column(\core\plugininfo\base $plugin, core_plugin_manager $pluginman, $version) {
|
||||
protected function required_column(\core\plugininfo\base $plugin, core_plugin_manager $pluginman, $version, $branch = null) {
|
||||
|
||||
$requires = array();
|
||||
$displayuploadlink = false;
|
||||
$displayupdateslink = false;
|
||||
|
||||
foreach ($pluginman->resolve_requirements($plugin, $version) as $reqname => $reqinfo) {
|
||||
$requirements = $pluginman->resolve_requirements($plugin, $version, $branch);
|
||||
foreach ($requirements as $reqname => $reqinfo) {
|
||||
if ($reqname === 'core') {
|
||||
if ($reqinfo->status == $pluginman::REQUIREMENT_STATUS_OK) {
|
||||
$class = 'requires-ok';
|
||||
|
@ -1469,7 +1476,19 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
$class = 'requires-failed';
|
||||
$label = html_writer::span(get_string('dependencyfails', 'core_plugin'), 'badge badge-danger');
|
||||
}
|
||||
if ($reqinfo->reqver != ANY_VERSION) {
|
||||
|
||||
if ($branch != null && !$plugin->is_core_compatible_satisfied($branch)) {
|
||||
$requires[] = html_writer::tag('li',
|
||||
html_writer::span(get_string('incompatibleversion', 'core_plugin', $branch), 'dep dep-core').
|
||||
' '.$label, array('class' => $class));
|
||||
|
||||
} else if ($branch != null && $plugin->pluginsupported != null) {
|
||||
$requires[] = html_writer::tag('li',
|
||||
html_writer::span(get_string('moodlebranch', 'core_plugin',
|
||||
array('min' => $plugin->pluginsupported[0], 'max' => $plugin->pluginsupported[1])), 'dep dep-core').
|
||||
' '.$label, array('class' => $class));
|
||||
|
||||
} else if ($reqinfo->reqver != ANY_VERSION) {
|
||||
$requires[] = html_writer::tag('li',
|
||||
html_writer::span(get_string('moodleversion', 'core_plugin', $plugin->versionrequires), 'dep dep-core').
|
||||
' '.$label, array('class' => $class));
|
||||
|
@ -1556,6 +1575,13 @@ class core_admin_renderer extends plugin_renderer_base {
|
|||
);
|
||||
}
|
||||
|
||||
// Check if supports is present, and $branch is not in, only if $incompatible check was ok.
|
||||
if ($plugin->pluginsupported != null && $class == 'requires-ok' && $branch != null) {
|
||||
if ($pluginman->check_explicitly_supported($plugin, $branch) == $pluginman::VERSION_NOT_SUPPORTED) {
|
||||
$out .= html_writer::div(get_string('notsupported', 'core_plugin', $branch));
|
||||
}
|
||||
}
|
||||
|
||||
return $out;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue