Skip to content

Commit

Permalink
MDL-71169 external: Use execute as the default external method name
Browse files Browse the repository at this point in the history
If the 'methodname' is not explicitly specified in db/services.php,
expect it to be 'execute'.
  • Loading branch information
mudrd8mz committed Mar 22, 2021
1 parent 4c26696 commit b9fbb75
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/upgrade.txt
Expand Up @@ -118,6 +118,8 @@ information provided here is intended especially for developers.
* The behat transformation 'string time to timestamp' no longer supports datetime format. If provided, the format must
be strftime compatible. Example:
- I should see "##tomorrow noon##%A, %d %B %Y, %I:%M %p##"
* External functions implementation classes should use 'execute' as the method name, in which case the
'methodname' property should not be specified in db/services.php file.

=== 3.10 ===
* PHPUnit has been upgraded to 8.5. That comes with a few changes:
Expand Down
3 changes: 2 additions & 1 deletion lib/upgradelib.php
Expand Up @@ -1211,6 +1211,7 @@ function external_update_descriptions($component) {
$function = $functions[$dbfunction->name];
unset($functions[$dbfunction->name]);
$function['classpath'] = empty($function['classpath']) ? null : $function['classpath'];
$function['methodname'] = $function['methodname'] ?? 'execute';

$update = false;
if ($dbfunction->classname != $function['classname']) {
Expand Down Expand Up @@ -1260,7 +1261,7 @@ function external_update_descriptions($component) {
$dbfunction = new stdClass();
$dbfunction->name = $fname;
$dbfunction->classname = $function['classname'];
$dbfunction->methodname = $function['methodname'];
$dbfunction->methodname = $function['methodname'] ?? 'execute';
$dbfunction->classpath = empty($function['classpath']) ? null : $function['classpath'];
$dbfunction->component = $component;
$dbfunction->capabilities = array_key_exists('capabilities', $function)?$function['capabilities']:'';
Expand Down

0 comments on commit b9fbb75

Please sign in to comment.