Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

796 fix moodle 42 fatal with core external lib changes #803

Open
wants to merge 5 commits into
base: MOODLE_35_STABLE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions classes/external/external_api.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.

namespace tool_dataflows\external;

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

// Moved as part of https://tracker.moodle.org/browse/MDL-78049 so this is
// required to redirect sites using older versions of Moodle to the previous
// implementation.
// Once the base supported version is 4.2, this is no longer required.
if (class_exists(\core_external\external_api::class)) {
\class_alias(\core_external\external_api::class, \tool_dataflows\external\external_api::class);
} else if (class_exists(\external_api::class)) {
\class_alias(\external_api::class, \tool_dataflows\external\external_api::class);
}
2 changes: 1 addition & 1 deletion classes/external/trigger_dataflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @copyright Catalyst IT, 2023
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class trigger_dataflow extends \external_api {
class trigger_dataflow extends external_api {

/**
* Returns description of method parameters
Expand Down
7 changes: 1 addition & 6 deletions classes/local/step/flow_web_service.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,10 @@

namespace tool_dataflows\local\step;

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

require_once($CFG->libdir . '/externallib.php');

use core_user;
use core\session\manager;
use external_api;
use tool_dataflows\external\external_api;
use moodle_exception;
use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Yaml\Yaml;
use Throwable;
use tool_dataflows\parser;
Expand Down
4 changes: 0 additions & 4 deletions tests/tool_dataflows_web_service_flow_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,8 @@
defined('MOODLE_INTERNAL') || die();

global $CFG;
require_once($CFG->libdir.'/externallib.php');
require_once(__DIR__ . '/application_trait.php');



use Symfony\Component\ExpressionLanguage\ExpressionLanguage;
use Symfony\Component\Yaml\Yaml;
use tool_dataflows\dataflow;
use tool_dataflows\local\execution\engine;
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
$plugin->version = 2023070500;
$plugin->release = 2023070500;
$plugin->requires = 2017051500; // Our lowest supported Moodle (3.3.0).
$plugin->supported = [35, 401]; // Available as of Moodle 3.9.0 or later.
$plugin->supported = [35, 402]; // Available as of Moodle 3.9.0 or later.
// TODO $plugin->incompatible = ; // Available as of Moodle 3.9.0 or later.
$plugin->component = 'tool_dataflows';
$plugin->maturity = MATURITY_ALPHA;
Expand Down