mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 05:58:34 +01:00
Merge branch 'MDL-82133' of https://github.com/lostrogit/moodle
This commit is contained in:
commit
e7a432c01d
10
.upgradenotes/MDL-82133-2024061206555177.yml
Normal file
10
.upgradenotes/MDL-82133-2024061206555177.yml
Normal file
@ -0,0 +1,10 @@
|
||||
issueNumber: MDL-82133
|
||||
notes:
|
||||
core_reportbuilder:
|
||||
- message: >-
|
||||
The following classes have been moved to use the new exception API as a l2 namespace:
|
||||
|
||||
- `core_reportbuilder\\report_access_exception` => `core_reportbuilder\\exception\\report_access_exception`
|
||||
- `core_reportbuilder\\source_invalid_exception` => `core_reportbuilder\\exception\\source_invalid_exception`
|
||||
- `core_reportbuilder\\source_unavailable_exception` => `core_reportbuilder\\exception\\source_unavailable_exception`
|
||||
type: changed
|
@ -49,4 +49,8 @@ $renamedclasses = [
|
||||
'core_question\\bank\\search\\condition' => 'core_question\\local\\bank\\condition',
|
||||
'core_question\\bank\\search\\category_condition' => 'qbank_managecategories\\category_condition',
|
||||
'core_question\\bank\\search\\hidden_condition' => 'qbank_deletequestion\\hidden_condition',
|
||||
// Since Moodle 4.5.
|
||||
'core_reportbuilder\\report_access_exception' => 'core_reportbuilder\\exception\\report_access_exception',
|
||||
'core_reportbuilder\\source_invalid_exception' => 'core_reportbuilder\\exception\\source_invalid_exception',
|
||||
'core_reportbuilder\\source_unavailable_exception' => 'core_reportbuilder\\exception\\source_unavailable_exception',
|
||||
];
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace core_reportbuilder;
|
||||
namespace core_reportbuilder\exception;
|
||||
|
||||
use moodle_exception;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace core_reportbuilder;
|
||||
namespace core_reportbuilder\exception;
|
||||
|
||||
use moodle_exception;
|
||||
|
@ -16,7 +16,7 @@
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace core_reportbuilder;
|
||||
namespace core_reportbuilder\exception;
|
||||
|
||||
use moodle_exception;
|
||||
|
@ -23,7 +23,7 @@ use core_external\external_multiple_structure;
|
||||
use core_external\external_single_structure;
|
||||
use core_external\external_function_parameters;
|
||||
use core_external\external_value;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\system_report_factory;
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@ class audience extends dynamic_form {
|
||||
/**
|
||||
* Ensure current user is able to use this form
|
||||
*
|
||||
* A {@see \core_reportbuilder\report_access_exception} will be thrown if they can't
|
||||
* A {@see \core_reportbuilder\exception\report_access_exception} will be thrown if they can't
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
$audience = $this->get_audience();
|
||||
|
@ -59,7 +59,7 @@ class condition extends dynamic_form {
|
||||
/**
|
||||
* Ensure current user is able to use this form
|
||||
*
|
||||
* A {@see \core_reportbuilder\report_access_exception} will be thrown if they can't
|
||||
* A {@see \core_reportbuilder\exception\report_access_exception} will be thrown if they can't
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
permission::require_can_edit_report($this->get_report()->get_report_persistent());
|
||||
|
@ -60,7 +60,7 @@ class filter extends dynamic_form {
|
||||
/**
|
||||
* Ensure current user is able to use this form
|
||||
*
|
||||
* A {@see \core_reportbuilder\report_access_exception} will be thrown if they can't
|
||||
* A {@see \core_reportbuilder\exception\report_access_exception} will be thrown if they can't
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
$reportpersistent = $this->get_report()->get_report_persistent();
|
||||
|
@ -74,7 +74,7 @@ class report extends dynamic_form {
|
||||
/**
|
||||
* Ensure current user is able to use this form
|
||||
*
|
||||
* A {@see \core_reportbuilder\report_access_exception} will be thrown if they can't
|
||||
* A {@see \core_reportbuilder\exception\report_access_exception} will be thrown if they can't
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
$report = $this->get_custom_report();
|
||||
|
@ -62,7 +62,7 @@ class schedule extends dynamic_form {
|
||||
/**
|
||||
* Ensure current user is able to use this form
|
||||
*
|
||||
* A {@see \core_reportbuilder\report_access_exception} will be thrown if they can't
|
||||
* A {@see \core_reportbuilder\exception\report_access_exception} will be thrown if they can't
|
||||
*/
|
||||
protected function check_access_for_dynamic_submission(): void {
|
||||
$persistent = $this->get_report()->get_report_persistent();
|
||||
|
@ -25,7 +25,7 @@ use core\output\notification;
|
||||
use core_reportbuilder\external\custom_report_audience_cards_exporter;
|
||||
use core_reportbuilder\local\helpers\database;
|
||||
use core_reportbuilder\local\models\audience;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
|
||||
/**
|
||||
* Audience base class
|
||||
|
@ -24,6 +24,7 @@ use core_plugin_manager;
|
||||
use stdClass;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_reportbuilder\local\report\base;
|
||||
use core_reportbuilder\exception\{source_invalid_exception, source_unavailable_exception};
|
||||
|
||||
/**
|
||||
* Report management class
|
||||
|
@ -20,6 +20,7 @@ namespace core_reportbuilder;
|
||||
|
||||
use context;
|
||||
use context_system;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\helpers\audience;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_reportbuilder\local\report\base;
|
||||
|
@ -20,6 +20,7 @@ namespace core_reportbuilder;
|
||||
|
||||
use action_menu_filler;
|
||||
use coding_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use html_writer;
|
||||
use stdClass;
|
||||
use core\output\checkbox_toggleall;
|
||||
|
@ -21,6 +21,7 @@ namespace core_reportbuilder;
|
||||
use context;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_reportbuilder\local\report\base;
|
||||
use core_reportbuilder\exception\source_invalid_exception;
|
||||
|
||||
/**
|
||||
* Factory class for creating system report instances
|
||||
|
@ -49,7 +49,7 @@ if ($reportpersistent->get('type') === \core_reportbuilder\local\report\base::TY
|
||||
$reportpersistent->get('area'), $reportpersistent->get('itemid'), $parameters);
|
||||
|
||||
if (!$systemreport->can_be_downloaded()) {
|
||||
throw new \core_reportbuilder\report_access_exception();
|
||||
throw new \core_reportbuilder\exception\report_access_exception();
|
||||
}
|
||||
|
||||
// Combine original report parameters with 'download' parameter.
|
||||
|
@ -23,7 +23,7 @@ use core_reportbuilder\local\models\audience;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\column;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\column;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\column;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns\sort;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns\sort;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\column;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\columns\sort;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\column;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\conditions;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\conditions;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\conditions;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -22,7 +22,7 @@ use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\manager;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -22,7 +22,7 @@ use core_reportbuilder\manager;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\filters;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\filters;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\filter;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\external\filters;
|
||||
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\manager;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\external\filters;
|
||||
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\manager;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\reports;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -22,7 +22,7 @@ use context_system;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -22,7 +22,7 @@ use context_system;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\reports;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -22,7 +22,7 @@ use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\event\report_viewed;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\schedules;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\schedules;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\task\send_schedule;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -21,7 +21,7 @@ namespace core_reportbuilder\external\schedules;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
@ -22,7 +22,7 @@ use core\context\system;
|
||||
use core_reportbuilder_generator;
|
||||
use core_external\external_api;
|
||||
use externallib_advanced_testcase;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder\local\systemreports\reports_list;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
|
@ -25,6 +25,7 @@ use core_user\reportbuilder\datasource\users;
|
||||
use stdClass;
|
||||
use core_reportbuilder\local\models\report;
|
||||
use core_reportbuilder\local\report\base;
|
||||
use core_reportbuilder\exception\{source_invalid_exception, source_unavailable_exception};
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,7 +20,7 @@ namespace core_reportbuilder\output;
|
||||
|
||||
use advanced_testcase;
|
||||
use core_reportbuilder_generator;
|
||||
use core_reportbuilder\report_access_exception;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
||||
/**
|
||||
|
@ -20,6 +20,7 @@ namespace core_reportbuilder;
|
||||
|
||||
use advanced_testcase;
|
||||
use context_system;
|
||||
use core_reportbuilder\exception\report_access_exception;
|
||||
use core_reportbuilder_generator;
|
||||
use Throwable;
|
||||
use core_user\reportbuilder\datasource\users;
|
||||
|
@ -21,6 +21,7 @@ namespace core_reportbuilder;
|
||||
use advanced_testcase;
|
||||
use context_system;
|
||||
use stdClass;
|
||||
use core_reportbuilder\exception\{source_invalid_exception, source_unavailable_exception};
|
||||
|
||||
/**
|
||||
* Unit tests for the system report factory class
|
||||
|
Loading…
x
Reference in New Issue
Block a user