-
Bug
-
Resolution: Won't Fix
-
Minor
-
None
-
3.1.8, 3.2.5, 3.3
-
MOODLE_31_STABLE, MOODLE_32_STABLE, MOODLE_33_STABLE
-
If two or more items (returned by a plugin and its sub-plugins) in https://github.com/moodle/moodle/blob/master/course/lib.php#L689 have the same link url, that line of code would assign them the same name too. This was causing that only the last item would appear in the activity chooser. Replacing "? $modname : $modname" by "? $modname : $item->name" in the previously mentioned line of code, the items get different names and thus, we fix this issue.
NEW ADDITIONAL INFO:
The use case here is:
1. I have an external tool activity subplugin that links to the same url as Moodle's external tool activity (so I don't have to reimplement all the LTI funcionality in my subplugin). This subplugin is still useful though because I can write a ltisource_pluginname_before_launch() function in the subplugins lib.php to, for example, rename the user roles the activity passes to the external tool based on the capabilities defined during the installation by this subplugin (see next, also included in the attached example).
function ltisource_sarlab_before_launch() {
global $USER;
$context = context_system::instance();
if (has_capability('ltisource/sarlab:createexp', $context, $USER)) {
$role = 'Designer';
} else if (has_capability('ltisource/sarlab:editexp', $context, $USER)) {
$role = 'Manager';
} else {
$role = 'Unauthorized';
}
$params = array('roles' => $role);
return $params;
}
2. I want to keep Moodle's original external tool activity, so it must still appear in the activity chooser with its original name.
3. The new subplugin activity must also appear in the activity chooser so I can add a new LTI activity that connects to the external tool to which I want to send the custom user roles.
- has been marked as being related by
-
MDL-45064 Option to add Preconfigured LTI Tool to Activity Chooser
- Closed