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

Deprecate views_entity_field_label() in favor of EntityFieldManager->getFieldLabels

$
0
0

Problem/Motivation

On #2900409: [Meta] Improve UI of Reference field settings form, Berdir noticed that the code for that patch was very similar to the views_entity_field_label() function.

Rather than maintaining this code in two places, it would be better if it was moved to be a method on a class accessible as a service. Berdir suggested maybe putting on the EntityFieldManager class.

Proposed resolution

Move to EntityFieldManager
Make views_entity_field_label() call that method.
Deprecate views_entity_field_label() -- meaning adding @deprecated tag to the doc block, adding trigger_error to the code, and replacing calls to that function in core.

Remaining tasks

Follow up:
Once that is done, we can also use the new function on #2900409: [Meta] Improve UI of Reference field settings form (which will be taken care of on that issue, not here).

User interface changes

None.

API changes

function views_entity_field_label() will be deprecated in favor of \Drupal::service('entity_field.manager')->getFieldLabels($entity_type_id, $field_name);

Data model changes

None.

Release notes snippet


Viewing all articles
Browse latest Browse all 293850

Trending Articles



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