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

docs for deprecated functions in core/includes/entity.inc refer to deprecated entityManager()

$
0
0

This file contains several functions which are marked as deprecated. The documentation tells you what you should use instead.

However, the thing the documentation tells you to use instead is *itself* deprecated! This needs to be fixed, so the advice is correct and up to date.

eg in entity_view()

 * @return array
 *   A render array for the entity.
 *
 * @deprecated as of Drupal 8.0.x, will be removed before Drupal 9.0.0.
 *   Use the entity view builder's view() method for creating a render array:
 * @code
 * $view_builder = \Drupal::entityManager()->getViewBuilder($entity->getEntityTypeId());
 * return $view_builder->view($entity, $view_mode, $langcode);
 * @endcode
 *
 * @see \Drupal\Core\Entity\EntityManagerInterface::getViewBuilder()
 * @see \Drupal\Core\Entity\EntityViewBuilderInterface::view()
 */
function entity_view(EntityInterface $entity, $view_mode, $langcode = NULL, $reset = FALSE) {

entityManager() is itself deprecated -- https://api.drupal.org/api/drupal/core!lib!Drupal.php/function/Drupal%3A...

Also, the use of the @code tag here is broken -- see https://api.drupal.org/api/drupal/core!includes!entity.inc/function/enti...


Viewing all articles
Browse latest Browse all 291641

Trending Articles



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