Skip to content

Commit

Permalink
MDL-72397 qbank_managecategories: Deprecate question_category_object
Browse files Browse the repository at this point in the history
This also deprecates moodle_list::display_page_numbers, which was only used in
question_category_object, and relied on the QUESTION_PAGE_LENGTH constant defined in
question_category_object.php
  • Loading branch information
marxjohnson committed Jul 30, 2024
1 parent 203ac05 commit 09052ec
Show file tree
Hide file tree
Showing 4 changed files with 207 additions and 15 deletions.
17 changes: 17 additions & 0 deletions .upgradenotes/MDL-72397-2024073009194182.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
issueNumber: MDL-72397
notes:
qbank_managecategories:
- message: >
`qbank_managecategories\question_category_object` is now completely
deprecated. Its methods have either been migrated to
`qbank_managecategories\question_categories`,
`core_question\category_manager`, or are no longer used at all.
type: deprecated
core:
- message: >
`moodle_list::display_page_numbers` was only used by
`qbank_managecategories`, and this usage has been removed, so the method
is now deprecated. This method was the only usage of the
`QUESTION_PAGE_LENGTH` constant, which was defined in
`question_category_object.php`, and so is also now deprecated.
type: deprecated
5 changes: 5 additions & 0 deletions lib/listlib.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,12 @@ abstract public function get_records();

/**
* display list of page numbers for navigation
*
* @deprecated Since Moodle 4.5 MDL-72397. This was only being used in \qbank_managecategories\question_catgegory_object,
* and that has been deprecated.
* @todo Final removal in Moodle 6.0 MDL-80804.
*/
#[\core\attribute\deprecated(null, since: '4.5', reason: 'No longer used.', mdl: 'MDL-72397')]
public function display_page_numbers() {
$html = '';
$topcount = count($this->items);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@

/**
* QUESTION_PAGE_LENGTH - Number of categories to display on page.
*
* @deprecated Since Moodle 4.5 MDL-72397. This was only used in moodle_list::display_page_numbers which is now deprecated.
* @todo Final removal in Moodle 6.0 MDL-80804.
*/
define('QUESTION_PAGE_LENGTH', 25);

Expand Down Expand Up @@ -79,11 +82,11 @@ class question_category_object {
* @param int|null $defaultcategory id of the current category. null if none.
* @param int $todelete id of the category to delete. 0 if none.
* @param context[] $addcontexts contexts where the current user can add questions.
* @deprecated Since Moodle 4.5 MDL-72397. Use \qbank_managecategories\question_categories instead.
* @deprecated Since Moodle 4.5 MDL-72397. Use \qbank_managecategories\question_categories or \core_question\category_manager.
* @todo Final removal in Moodle 6.0 MDL-80804
*/
#[\core\attribute\deprecated(
'\qbank_managecategories\question_categories',
'\qbank_managecategories\question_categories or \core_question\category_manager',
since: 4.5,
reason: 'API properly divided between qbank_managecategories and core_question',
mdl: 'MDL-72397',
Expand Down
Loading

0 comments on commit 09052ec

Please sign in to comment.