mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
mnet MDL-21473 fixed a small bug in the mnet installer and updated the testclient
This commit is contained in:
parent
f54dfa54b7
commit
8509b7c431
2 changed files with 23 additions and 8 deletions
|
@ -178,7 +178,7 @@ function upgrade_plugin_mnet_functions($component) {
|
||||||
$serviceobj = $servicecache[$service];
|
$serviceobj = $servicecache[$service];
|
||||||
}
|
}
|
||||||
foreach ($methods as $method => $xmlrpcpath) {
|
foreach ($methods as $method => $xmlrpcpath) {
|
||||||
if (!$rpcid = $DB->record_exists('mnet_remote_rpc', array('xmlrpcpath'=>$xmlrpcpath))) {
|
if (!$rpcid = $DB->get_field('mnet_remote_rpc', 'id', array('xmlrpcpath'=>$xmlrpcpath))) {
|
||||||
$remoterpc = (object)array(
|
$remoterpc = (object)array(
|
||||||
'functionname' => $method,
|
'functionname' => $method,
|
||||||
'xmlrpcpath' => $xmlrpcpath,
|
'xmlrpcpath' => $xmlrpcpath,
|
||||||
|
|
|
@ -80,19 +80,34 @@ if (!empty($hostid) && array_key_exists($hostid, $hosts)) {
|
||||||
get_string('options', 'mnet'),
|
get_string('options', 'mnet'),
|
||||||
);
|
);
|
||||||
$table->data = array();
|
$table->data = array();
|
||||||
$sql = 'SELECT s.name, min(r.plugintype) AS plugintype, min(r.pluginname) AS pluginname
|
|
||||||
FROM {mnet_service} s
|
|
||||||
JOIN {mnet_service2rpc} s2r ON s2r.serviceid = s.id
|
|
||||||
JOIN {mnet_rpc} r ON r.id = s2r.rpcid
|
|
||||||
GROUP BY s.name';
|
|
||||||
|
|
||||||
$yesno = array(get_string('no'), get_string('yes'));
|
$yesno = array(get_string('no'), get_string('yes'));
|
||||||
|
|
||||||
$serviceinfo = $DB->get_records_sql($sql);
|
// this query is horrible and has to be remapped afterwards, because of the non-uniqueness
|
||||||
|
// of the remoterep service (it has two plugins so far that use it)
|
||||||
|
// it's possible to get a unique list back using a subquery with LIMIT but that would break oracle
|
||||||
|
// so it's best to just do this small query and then remap the results afterwards
|
||||||
|
$sql = '
|
||||||
|
SELECT DISTINCT
|
||||||
|
' . $DB->sql_concat('r.plugintype', "'_'", 'r.pluginname', "'_'", 's.name') . ' AS unique,
|
||||||
|
s.name,
|
||||||
|
r.plugintype,
|
||||||
|
r.pluginname
|
||||||
|
FROM
|
||||||
|
{mnet_service} s
|
||||||
|
JOIN {mnet_remote_service2rpc} s2r ON s2r.serviceid = s.id
|
||||||
|
JOIN {mnet_remote_rpc} r ON r.id = s2r.rpcid';
|
||||||
|
|
||||||
|
$serviceinfo = array();
|
||||||
|
|
||||||
|
foreach ($DB->get_records_sql($sql) as $result) {
|
||||||
|
$serviceinfo[$result->name] = $result->plugintype . '_' . $result->pluginname;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($services as $id => $servicedata) {
|
foreach ($services as $id => $servicedata) {
|
||||||
if (array_key_exists($servicedata['name'], $serviceinfo)) {
|
if (array_key_exists($servicedata['name'], $serviceinfo)) {
|
||||||
$service = $serviceinfo[$servicedata['name']];
|
$service = $serviceinfo[$servicedata['name']];
|
||||||
$servicedata['humanname'] = get_string($servicedata['name'].'_name', $service->plugintype . '_' . $service->pluginname);
|
$servicedata['humanname'] = get_string($servicedata['name'].'_name', $service);
|
||||||
} else {
|
} else {
|
||||||
$servicedata['humanname'] = get_string('unknown', 'mnet');
|
$servicedata['humanname'] = get_string('unknown', 'mnet');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue