project: Moodle
summary: META: Collect together deprecated code changes for Moodle 2.8
description: There are a number of parts of the Moodle codebase that have been marked as deprecated as a warning to developers not to use these functions as they will be removed in future. Many have a deadline of 2.8. Each of these deprecated functions, especially those in Moodle core code, should have an MDL issue associated with it. In order to time the removal of these deprecated functio issues and not lose sight of them, this issue will be used to collect them together.

1.summary: Prevent admins to add deprecated WS functions to web services
description: I noticed that we have a lot of deprecated web services functions which were deprecated in 2.2, but not removed. I feel that web services should be deprecated in the same way as other functions but can someone confirm. See `git grep deprecated | grep externallib` for the list
2.summary: Remove the method get_context_instance_by_id() from core
description: Remove the method get_context_instance_by_id() from core
3.summary: Remove get_context_instance() from core
description: The function was deprecated in 2.1 and removed from core with a deprecated warning in 2.4 Refer for further details. It should be safe to remove the function from core in 2.6 Thanks
4.summary: Finalise deprecation of function forum_shorten_post()
description: The function forum_shorten_post() was deprecated from mod/forum/lib.php in Moodle 2.6. The function body of forum_shorten_post() in lib/deprecationlib.php needs to be replaced with... code throw new coding_exception(forum_shorten_post() can not be used any more. Please use shorten_text($message, $CFG->forum_shortpost) instead.); code
5.summary: Remove post_form.php from mod_forum
description: This file is not used any more and can be removed during 2.8-dev for 2.8 release.
6.summary: Finalise deprecation of repository sync methods
description: In the repositories API for synchronising external references was simplified. Remove completely: stored_file::set_filesize() stored_file::replace_content_with() repository::reset_caches() repository::sync_external_file() In repository::__call() remove code related to functions: sync_individual_file() get_file_by_reference() get_reference_file_lifetime() _probably there will be nothing left in __call() at all so it can be deleted._ In repository::sync_reference() remove all code starting from comment "Backward compatibility (Moodle 2.3-2.5)". Replace it with "return false;"
7.summary: Block method preferred_width() is obsolete and should be deprecated
description: At least, im pretty certain its not in use by anything and should be removed from all core blocks.

Below is an instruction that describes a task, paired with an input that provides an epic with this format: 
"project": "Name of the project" 
"summary": "Summary of the epic user story" 
"description": "Description of the epic user story". Write a response that appropriately completes the request.### Instruction:
Break this epic user story into smaller tasks to help the developers understand the epic better, you can divide this epic into as much as you want depending on the complexity of the epic.
### Input:
project: Moodle
summary: META: Collect together deprecated code changes for Moodle 2.8
description: There are a number of parts of the Moodle codebase that have been marked as deprecated as a warning to developers not to use these functions as they will be removed in future. Many have a deadline of 2.8. Each of these deprecated functions, especially those in Moodle core code, should have an MDL issue associated with it. In order to time the removal of these deprecated functio issues and not lose sight of them, this issue will be used to collect them together.

### Response:
1.summary: Prevent admins to add deprecated WS functions to web services
description: I noticed that we have a lot of deprecated web services functions which were deprecated in 2.2, but not removed. I feel that web services should be deprecated in the same way as other functions but can someone confirm. See `git grep deprecated | grep externallib` for the list
2.summary: Remove the method get_context_instance_by_id() from core
description: Remove the method get_context_instance_by_id() from core
3.summary: Remove get_context_instance() from core
description: The function was deprecated in 2.1 and removed from core with a deprecated warning in 2.4 Refer for further details. It should be safe to remove the function from core in 2.6 Thanks
4.summary: Finalise deprecation of function forum_shorten_post()
description: The function forum_shorten_post() was deprecated from mod/forum/lib.php in Moodle 2.6. The function body of forum_shorten_post() in lib/deprecationlib.php needs to be replaced with... code throw new coding_exception(forum_shorten_post() can not be used any more. Please use shorten_text($message, $CFG->forum_shortpost) instead.); code
5.summary: Remove post_form.php from mod_forum
description: This file is not used any more and can be removed during 2.8-dev for 2.8 release.
6.summary: Finalise deprecation of repository sync methods
description: In the repositories API for synchronising external references was simplified. Remove completely: stored_file::set_filesize() stored_file::replace_content_with() repository::reset_caches() repository::sync_external_file() In repository::__call() remove code related to functions: sync_individual_file() get_file_by_reference() get_reference_file_lifetime() _probably there will be nothing left in __call() at all so it can be deleted._ In repository::sync_reference() remove all code starting from comment "Backward compatibility (Moodle 2.3-2.5)". Replace it with "return false;"
7.summary: Block method preferred_width() is obsolete and should be deprecated
description: At least, im pretty certain its not in use by anything and should be removed from all core blocks.
