Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

field_info_instances replacement #16

Open
mglaman opened this issue Jun 30, 2023 · 0 comments
Open

field_info_instances replacement #16

mglaman opened this issue Jun 30, 2023 · 0 comments

Comments

@mglaman
Copy link
Collaborator

mglaman commented Jun 30, 2023

https://git.drupalcode.org/project/drupal/-/blob/7.x/modules/field/field.info.inc#L569-607

Retrieves information about field instances.

function field_info_instances($entity_type = NULL, $bundle_name = NULL);
 * @return
 *   If $entity_type is not set, return all instances keyed by entity type and
 *   bundle name. If $entity_type is set, return all instances for that entity
 *   type, keyed by bundle name. If $entity_type and $bundle_name are set, return
 *   all instances for that bundle.

The function was replaced by the entity_field.manager service.

  • No replacement for null $entity_type
  • If $entity_type is set but no $bundle_name: \Drupal\Core\Entity\EntityFieldManagerInterface::getBaseFieldDefinitions
  • Otherwise \Drupal\Core\Entity\EntityFieldManagerInterface::getFieldDefinitions

https://www.drupal.org/project/drupal/issues/2225739 is the issue where the function was removed for the field manager service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant