Skip to content

Commit 6860e59

Browse files
committed
fix: add backwards compatibility layer for external_lib usage under Moodle 4.2
1 parent 857cdbf commit 6860e59

File tree

4 files changed

+36
-7
lines changed

4 files changed

+36
-7
lines changed

classes/external/external_api.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<?php
2+
// This file is part of Moodle - http://moodle.org/
3+
//
4+
// Moodle is free software: you can redistribute it and/or modify
5+
// it under the terms of the GNU General Public License as published by
6+
// the Free Software Foundation, either version 3 of the License, or
7+
// (at your option) any later version.
8+
//
9+
// Moodle is distributed in the hope that it will be useful,
10+
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
// GNU General Public License for more details.
13+
//
14+
// You should have received a copy of the GNU General Public License
15+
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
16+
17+
namespace tool_dataflows\external;
18+
19+
// Moved as part of https://tracker.moodle.org/browse/MDL-78049 so this is
20+
// required to redirect sites using older versions of Moodle to the previous
21+
// implementation.
22+
// Once the base supported version is 4.2, this is no longer required.
23+
if (class_exists(\core_external\external_api::class) && !class_exists(\external_api::class)) {
24+
class_alias(\core_external\external_api::class, \external_api::class);
25+
}
26+
27+
/**
28+
* Backwards compatibility class for underlying core's external_api
29+
*/
30+
class external_api extends \external_api {
31+
}

classes/external/trigger_dataflow.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* @copyright Catalyst IT, 2023
3232
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
3333
*/
34-
class trigger_dataflow extends \external_api {
34+
class trigger_dataflow extends external_api {
3535

3636
/**
3737
* Returns description of method parameters

classes/local/step/flow_web_service.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@
1616

1717
namespace tool_dataflows\local\step;
1818

19-
defined('MOODLE_INTERNAL') || die();
20-
2119
use core_user;
2220
use core\session\manager;
23-
use core_external\external_api;
21+
use tool_dataflows\external\external_api;
2422
use moodle_exception;
2523
use Symfony\Component\Yaml\Yaml;
2624
use Throwable;

version.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525

2626
defined('MOODLE_INTERNAL') || die();
2727

28-
$plugin->version = 2023063000;
29-
$plugin->release = 2023063000;
28+
$plugin->version = 2023070500;
29+
$plugin->release = 2023070500;
3030
$plugin->requires = 2017051500; // Our lowest supported Moodle (3.3.0).
31-
$plugin->supported = [35, 401]; // Available as of Moodle 3.9.0 or later.
31+
$plugin->supported = [35, 402]; // Available as of Moodle 3.9.0 or later.
3232
// TODO $plugin->incompatible = ; // Available as of Moodle 3.9.0 or later.
3333
$plugin->component = 'tool_dataflows';
3434
$plugin->maturity = MATURITY_ALPHA;

0 commit comments

Comments
 (0)