Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 295245

Deprecate/rename drupal_add_feed(), drupal_add_html_head(), drupal_add_html_head_link(), drupal_add_http_header(), and allow to be set declaratively in #attached

$
0
0

Problem/Motivation

$build['#attached']['drupal_add_feed']
This is a) a confusing API and b) we don't want to keep drupal_add_feed forever.

Proposed resolution

  • Rename all drupal_add_* methods to use an underscore (like css/js)
  • Make it possible to use $build['#attached']['feed|html_head|html_head_link']

Remaining tasks

User interface changes

API changes

  • '#attached][drupal_add_feed' => 'feed'
  • '#attached][drupal_html_head' => 'html_head'
  • '#attached][drupal_add_http_header' => 'http_head'

drupal_add_region_content() and drupal_set_region_content() are also removed - these were dead code already.

Original report by @username

We removed direct calls to drupal_add_html_head_link() but didn't deprecate either that or drupal_add_feed().

Opening this as a critical follow-up, we realised this during the DrupalCon Amsterdam discussion about page rendering.

https://api.drupal.org/api/drupal/core%21includes%21common.inc/function/...

https://api.drupal.org/api/drupal/core%21includes%21common.inc/function/...

Additionally, we decided to formalize the #attached support in https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Page%21Re... so it doesn't use the function names (i.e. you can use #attached['head_link'] or similar). Looks like dynamic function support has already been removed there.


Viewing all articles
Browse latest Browse all 295245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>