Merge branch 'MDL-63297' of https://github.com/timhunt/moodle
[moodle.git] / blocks / upgrade.txt
blob6ed2bea30ba103c288da68b4810fce7b7d4b50bd
1 This files describes API changes in /blocks/* - activity modules,
2 information provided here is intended especially for developers.
4 === 3.6 ===
6 * The timeline view from block_myoverview has been split out into block_timeline.
7 * External function core_blocks::get_course_blocks now returns the block visible status and weight for ordering.
8 * New method added block_base::get_content_for_external(). It will return all the block contents rendered for external functions.
9   If your block is returning formatted content or provide files for download, you should override this method to use the
10   external_format_text, external_format_string functions for formatting or external_util::get_area_files for files.
11   See block_html as example.
12 * External functions core_block::get_course_blocks and core_block::get_dashboard_blocks have a new parameter to indicate if
13   you want to receive the block contents.
15 === 3.4 ===
17 * The block_instances table now contains fields timecreated and timemodified. If third-party code
18   creates or updates these rows (without using the standard API), it should be modified to set
19   these fields as appropriate.
20 * Blocks can now be included in Moodle global search, with some limitations (at present, the search
21   works only for blocks located directly on course pages or site home page). See the HTML block for
22   an example.
23 * Block block_messages is no longer a part of core.
25 === 3.3 ===
27 * block_manager::get_required_by_theme_block_types() is no longer static.
28 * The plugin block_course_overview has been removed from core and is being replaced by block_myoverview.
29   During the upgrade process the block_course_overview block will be uninstalled and all its settings will be deleted.
30   If you wish to keep the block_course_overview block and its settings, download it from moodle.org and put it back in
31   the blocks/ directory BEFORE UPGRADING.
33 === 3.1 ===
35 * The collapsed class was removed from the navigation block to make it compatible with aria.
36 * New aria attributes were added on the navigation block [aria-expanded="false"].
37 * The tree JS handling were moved from YUI to AMD module (Jquery).
39 === 2.9 ===
41 * The obsolete method preferred_width() was removed (it was not doing anything)
42 * Deprecated block_base::config_save as is not called anywhere and should not be used.
43 * Added instance_copy() function to the block_base class. This function allows for block
44   specific data to be copied when a block is copied.
46 === 2.8 ===
48 * The instance_config_print() function was removed. It was deprecated in
49   Moodle 2.0, but without debugging notices. Since it was no longer a part
50   of the code path, debugging notices would not have been displayed.
51 * Deprecated functions were removed from the block_base class:
52 ** _print_block()
53 ** _print_shadow()
54 ** _title_html()
55 ** _add_edit_controls()
56 ** config_print()
58 === 2.6 ===
60 * Deprecated /admin/block.php was removed, make sure blocks are using settings.php instead.
62 === 2.4 ===
64 Created new capability 'blocks/xxx:myaddinstance' that determines whether a user can add
65 a specific block to their My Home page. This capability was only defined for blocks where
66 the applicable_formats function does not include "'my' => false" in the returned array,
67 allowing it be added to the My Home page.
69 === 2.3 ===
71 required changes in code:
72 * block_xxx_pluginfile() is now given the 7th parameter (hopefully the last one) that
73   contains additional options for the file serving. The array should be re-passed
74   to send_stored_file().
76 === 2.0 ===
78 required changes in code:
79 * use new DML syntax everywhere
80 * use new DDL syntax in db/upgrade.php
81 * replace defaults.php by settings.php and db/install.php
82 * replace STATEMENTS section in db/install.xml by db/install.php
83 * move post instalation code from install() method into db/install.php
84 * completely rewrite file handling
85 * rewrite backup/restore
86 * theme changes: move plugin styles into blocks/xxx/styles.css and use new css markers for images,
87                  move all images into new blocks/xxx/pix/ directory and use new outputlib api
88                  old global $THEME is fully replaced by $OUTPUT
89 * remove '_utf8' from language pack names, use new {$a} syntax in language packs
90 * use 'pluginname' lang pack identifier instead of 'blockname'
91 * move cron and version number into standard version.php
92 * removed support for old config_global.html, use settings.php