Skip to content

Commit c215b8e

Browse files
committed
Fix deprecated callback (Moodle 4.5 compatibility)
1 parent e619a01 commit c215b8e

File tree

3 files changed

+72
-2
lines changed

3 files changed

+72
-2
lines changed

classes/hook_callbacks.php

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
// This file is part of Moodle - https://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 <https://www.gnu.org/licenses/>.
16+
17+
namespace mod_cms;
18+
19+
/**
20+
* Hook callbacks for tool_redirects.
21+
*
22+
* @package mod_cms
23+
* @author Alexander Van der Bellen <[email protected]>
24+
* @copyright 2024 Catalyst IT Australia
25+
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
26+
*/
27+
class hook_callbacks {
28+
29+
/**
30+
* Listener for the after_config hook.
31+
*
32+
* @param \core\hook\after_config $hook
33+
*/
34+
public static function after_config(\core\hook\after_config $hook): void {
35+
// The original callback performs no operations, so we don't need to do anything here.
36+
}
37+
}

db/hooks.php

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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+
/**
18+
* Hook callbacks.
19+
*
20+
* @package mod_cms
21+
* @author Alexander Van der Bellen <[email protected]>
22+
* @copyright 2024 Catalyst IT Australia
23+
* @license https://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
24+
*/
25+
26+
defined('MOODLE_INTERNAL') || die();
27+
28+
$callbacks = [
29+
[
30+
'hook' => \core\hook\after_config::class,
31+
'callback' => '\mod_cms\hook_callbacks::after_config',
32+
],
33+
];

version.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525

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

28-
$plugin->version = 2024090305;
28+
$plugin->version = 2024090306;
2929
$plugin->requires = 2022112800; // Moodle 4.1 and above.
30-
$plugin->supported = [401, 401]; // Moodle 4.1.
30+
$plugin->supported = [401, 405]; // Moodle 4.1.
3131
$plugin->component = 'mod_cms';
3232
$plugin->maturity = MATURITY_STABLE;
3333
$plugin->release = 2023051800;

0 commit comments

Comments
 (0)