Thanks to issues including
#2350943: [Meta] Untangle Drupal 8 page rendering
#2184907: Remove uses of drupal_add_http_header and related functions
#2073823: [META] Remove drupal_add_js() calls
#2073819: [META] Remove direct calls to drupal_add_css()
the following functions are no longer available for general use, to be removed in #2477223: Refactor _drupal_add_html_head, drupal_get_html_head, _drupal_add_html_head_link into the attachments processor, remove from common.inc.
_drupal_add_html_head()
drupal_get_html_head
_drupal_add_html_head_link()
They are still marked deprecated, but that's not really accurate. As far as third party code is concerned they should be considered removed.
drupal_process_attached() does still exist and is still a public API, but the documentation is incorrect. Specifically, it doesn't mention the types handled in the final foreach of the function, and it suggests that you can call arbitrary functions which is incorrect.
Remaining tasks
- Identify how "private" functions should be documented: See #2382873: [policy] Formalize coding standard for functions not intended for public use
- Replace @deprecated tags with that documentation
- Update drupal_processed_attached documentation
Comments
Comment #1
ianthomas_ukComment #2
rickvug commentedI scanned common.inc to gauge where functions related to JS/CSS attachment were at. See the status below. Beyond what is already marked as deprecated I see that there are additional functions and constants that are also prime candidates for refactoring and removal. While updating documentation to be accurate is useful, I wonder if a full plan to complete the refactoring is warranted. There was some great refactoring of drupal_render recently (#2346937: Implement a Renderer service; reduces drupal_render / _theme service container calls) as well as a lot of work on streamlining page rendering. This work might fit right in and help complete the picture while also providing improved consistency.
Deprecated:
Other related functions not marked as deprecated:
Related constants (prime candidates for refactoring):
Comment #3
ianthomas_ukAt this stage in the release process, any additional functions that we deprecate would need to be marked "will be removed before Drupal 9".
Many of the functions you mentioned are already being dealt with in #2205673: [META] Remove all @deprecated functions marked "remove before 8.0", this issue doesn't need to worry about any functions that we're actually going to remove before 8.
Some of the functions mentioned in the issue summary don't currently start with an underscore, so we need to decide what to do with those. Is it too late to add an underscore, even if the function doesn't work, or doesn't work the same way as it did in Drupal 7?
Comment #4
mile23See: #2467759: Refactor drupal_process_attached() so it doesn't depend on drupal_add_http_header()
Comment #5
andypostFixed IS - only 3 functions left that should be removed in #2477223: Refactor _drupal_add_html_head, drupal_get_html_head, _drupal_add_html_head_link into the attachments processor, remove from common.inc.
Comment #6
mile23I'm calling this a duplicate of #2477223: Refactor _drupal_add_html_head, drupal_get_html_head, _drupal_add_html_head_link into the attachments processor, remove from common.inc. In that issue we can update documentation for
drupal_process_attached()as needed.The @deprecated
_drupal_add_html_head(),drupal_get_html_head(), and_drupal_add_html_head_link()will be vanishing, and whether or notdrupal_process_attached()will remain is being considered in this issue: #2552865: Deprecate drupal_process_attached() for 8.0.0 and either throw an Exception or make it work via the RenderContext