MDL-75535 files: implement files datasource for custom reporting.
[moodle.git] / blocks / upgrade.txt
blob25fefc78a6ffbaec01429bf52f22f7a0c98a5dfb
1 This files describes API changes in /blocks/* - activity modules,
2 information provided here is intended especially for developers.
4 === 4.0 ===
6 * Block block_quiz_results has been completely removed from core.
7 The Quiz results block is hidden by default since Moodle 2.9. It is recommended to use the Activity results block instead, which works with any type of activity (not just quizzes).
8 * External function core_block::get_dashboard_blocks has a new parameter to indicate if you want to receive the block on the my/courses page.
9 * The `core_block_fetch_addable_blocks` external method accepts an optional `subpage` parameter, in order to correctly
10   calculate available blocks for pages that use this property (e.g. the user dashboard)
11 * A new method, can_block_be_added(), has been added to let blocks override it when they want to include some extra checks
12 to decide whether the block can be added to a page or not.
14 === 3.8 ===
15 * Block block_community is no longer a part of core.
16 * Block block_participants is no longer a part of core.
17 * Block plugins should overwrite get_config_for_external function to return the blocks settings viewable by the current user.
18   If the block plugin does not have any setting that could be considerated private (like a private/access key/token),
19   is ok to return all the settings via the get_config_for_external function.
21 === 3.7 ===
22 * The block:addinstance capability is no longer required if the block can only be added to a dashboard.
24 === 3.6 ===
26 * The timeline view from block_myoverview has been split out into block_timeline.
27 * External function core_blocks::get_course_blocks now returns the block visible status and weight for ordering.
28 * New method added block_base::get_content_for_external(). It will return all the block contents rendered for external functions.
29   If your block is returning formatted content or provide files for download, you should override this method to use the
30   external_format_text, external_format_string functions for formatting or external_util::get_area_files for files.
31   See block_html as example.
32 * External functions core_block::get_course_blocks and core_block::get_dashboard_blocks have a new parameter to indicate if
33   you want to receive the block contents.
35 === 3.4 ===
37 * The block_instances table now contains fields timecreated and timemodified. If third-party code
38   creates or updates these rows (without using the standard API), it should be modified to set
39   these fields as appropriate.
40 * Blocks can now be included in Moodle global search, with some limitations (at present, the search
41   works only for blocks located directly on course pages or site home page). See the HTML block for
42   an example.
43 * Block block_messages is no longer a part of core.
45 === 3.3 ===
47 * block_manager::get_required_by_theme_block_types() is no longer static.
48 * The plugin block_course_overview has been removed from core and is being replaced by block_myoverview.
49   During the upgrade process the block_course_overview block will be uninstalled and all its settings will be deleted.
50   If you wish to keep the block_course_overview block and its settings, download it from moodle.org and put it back in
51   the blocks/ directory BEFORE UPGRADING.
53 === 3.1 ===
55 * The collapsed class was removed from the navigation block to make it compatible with aria.
56 * New aria attributes were added on the navigation block [aria-expanded="false"].
57 * The tree JS handling were moved from YUI to AMD module (Jquery).
59 === 2.9 ===
61 * The obsolete method preferred_width() was removed (it was not doing anything)
62 * Deprecated block_base::config_save as is not called anywhere and should not be used.
63 * Added instance_copy() function to the block_base class. This function allows for block
64   specific data to be copied when a block is copied.
66 === 2.8 ===
68 * The instance_config_print() function was removed. It was deprecated in
69   Moodle 2.0, but without debugging notices. Since it was no longer a part
70   of the code path, debugging notices would not have been displayed.
71 * Deprecated functions were removed from the block_base class:
72 ** _print_block()
73 ** _print_shadow()
74 ** _title_html()
75 ** _add_edit_controls()
76 ** config_print()
78 === 2.6 ===
80 * Deprecated /admin/block.php was removed, make sure blocks are using settings.php instead.
82 === 2.4 ===
84 Created new capability 'blocks/xxx:myaddinstance' that determines whether a user can add
85 a specific block to their My Home page. This capability was only defined for blocks where
86 the applicable_formats function does not include "'my' => false" in the returned array,
87 allowing it be added to the My Home page.
89 === 2.3 ===
91 required changes in code:
92 * block_xxx_pluginfile() is now given the 7th parameter (hopefully the last one) that
93   contains additional options for the file serving. The array should be re-passed
94   to send_stored_file().
96 === 2.0 ===
98 required changes in code:
99 * use new DML syntax everywhere
100 * use new DDL syntax in db/upgrade.php
101 * replace defaults.php by settings.php and db/install.php
102 * replace STATEMENTS section in db/install.xml by db/install.php
103 * move post instalation code from install() method into db/install.php
104 * completely rewrite file handling
105 * rewrite backup/restore
106 * theme changes: move plugin styles into blocks/xxx/styles.css and use new css markers for images,
107                  move all images into new blocks/xxx/pix/ directory and use new outputlib api
108                  old global $THEME is fully replaced by $OUTPUT
109 * remove '_utf8' from language pack names, use new {$a} syntax in language packs
110 * use 'pluginname' lang pack identifier instead of 'blockname'
111 * move cron and version number into standard version.php
112 * removed support for old config_global.html, use settings.php