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