Commit 0d1cf2c1 authored by Dries's avatar Dries

Issue #2028403 by fago: Mark field_attach_()* functions as deprecated.

parent da60ebc3
......@@ -320,6 +320,8 @@ function hook_field_formatter_info_alter(array &$info) {
* @param $langcode
* The language the field values are going to be entered in. If no language is
* provided the default site language will be used.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function hook_field_attach_form(\Drupal\Core\Entity\EntityInterface $entity, &$form, &$form_state, $langcode) {
// Add a checkbox allowing a given field to be emptied.
......@@ -345,6 +347,8 @@ function hook_field_attach_form(\Drupal\Core\Entity\EntityInterface $entity, &$f
* for subsequent loads.
*
* See field_attach_load() for details and arguments.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function hook_field_attach_load($entity_type, $entities, $age, $options) {
// @todo Needs function body.
......@@ -365,6 +369,8 @@ function hook_field_attach_load($entity_type, $entities, $age, $options) {
* $form_state['values'].
* @param $form_state
* An associative array containing the current state of the form.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function hook_field_attach_extract_form_values(\Drupal\Core\Entity\EntityInterface $entity, $form, &$form_state) {
// Sample case of an 'Empty the field' checkbox added on the form, allowing
......@@ -437,6 +443,8 @@ function hook_field_attach_purge(\Drupal\Core\Entity\EntityInterface $entity, $f
* See field_view_field() for more information on what its $display_options
* argument contains.
* - langcode: The language code used for rendering.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function hook_field_attach_view_alter(&$output, $context) {
// Append RDF term mappings on displayed taxonomy links.
......
......@@ -507,6 +507,8 @@ function _field_invoke_widget_target($form_display) {
* An associative array of additional options. See field_invoke_method() for
* details.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*
* @see field_form_get_state()
* @see field_form_set_state()
*/
......@@ -562,6 +564,8 @@ function field_attach_form(EntityInterface $entity, &$form, &$form_state, $langc
* - instance: A field instance entity, If provided, only values for the
* corresponding field will be loaded, and no cache is written. This
* option is only supported when all $entities are within the same bundle.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $options = array()) {
$load_current = $age == FIELD_LOAD_CURRENT;
......@@ -733,6 +737,8 @@ function field_attach_load($entity_type, $entities, $age = FIELD_LOAD_CURRENT, $
* @param $options
* An associative array of additional options. See field_attach_load() for
* details.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_load_revision($entity_type, $entities, $options = array()) {
return field_attach_load($entity_type, $entities, FIELD_LOAD_REVISION, $options);
......@@ -766,6 +772,8 @@ function field_attach_load_revision($entity_type, $entities, $options = array())
* @param array $options
* An associative array of additional options. See field_invoke_method() for
* details.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_form_validate(EntityInterface $entity, $form, &$form_state, array $options = array()) {
// Only support NG entities.
......@@ -813,6 +821,8 @@ function field_attach_form_validate(EntityInterface $entity, $form, &$form_state
* @param array $options
* An associative array of additional options. See field_invoke_method() for
* details.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_extract_form_values(EntityInterface $entity, $form, &$form_state, array $options = array()) {
// Ensure we are working with a BC mode entity.
......@@ -843,6 +853,8 @@ function field_attach_extract_form_values(EntityInterface $entity, $form, &$form
* @return
* Default values (if any) will be added to the $entity parameter for fields
* it leaves unspecified.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_insert(EntityInterface $entity) {
// Ensure we are working with a BC mode entity.
......@@ -882,6 +894,8 @@ function field_attach_insert(EntityInterface $entity) {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity with fields to save.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_update(EntityInterface $entity) {
// Ensure we are working with a BC mode entity.
......@@ -924,6 +938,8 @@ function field_attach_update(EntityInterface $entity) {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity whose field data to delete.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_delete(EntityInterface $entity) {
// Ensure we are working with a BC mode entity.
......@@ -955,6 +971,8 @@ function field_attach_delete(EntityInterface $entity) {
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity with fields to save.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_delete_revision(EntityInterface $entity) {
// Ensure we are working with a BC mode entity.
......@@ -998,6 +1016,8 @@ function field_attach_delete_revision(EntityInterface $entity) {
* @param $langcode
* (Optional) The language the field values are to be shown in. If no language
* is provided the current language is used.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_prepare_view($entity_type, array $entities, array $displays, $langcode = NULL) {
$options['langcode'] = array();
......@@ -1060,6 +1080,8 @@ function field_attach_prepare_view($entity_type, array $entities, array $display
*
* @return array
* A renderable array for the field values.
*
* @deprecated as of Drupal 8.0. Use the entity system instead.
*/
function field_attach_view(EntityInterface $entity, EntityDisplay $display, $langcode = NULL, array $options = array()) {
// Ensure we are working with a BC mode entity.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment