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...
Comment | File | Size | Author |
---|---|---|---|
#14 | interdiff-2731309-12-14.txt | 2.55 KB | Vinay15 |
#14 | 2731309-14.patch | 10.49 KB | Vinay15 |
#12 | interdiff-2731309-9-12.txt | 5.4 KB | ashishdalvi |
#12 | 2731309-12.patch | 10.26 KB | ashishdalvi |
#9 | interdiff-2731309-5-9.txt | 9.43 KB | Vinay15 |
Comments
Comment #2
Vinay15Comment #3
Vinay15Hey Joachim, will changing entityManager() to entityTypeManager() work?
Comment #4
joachim CreditAttribution: joachim as a volunteer commentedFor getViewBuilder(), yes. I'm not sure about any other methods though.
Comment #5
Vinay15I have tried to remove the deprecated functions. Correct me if I am wrong.
Comment #7
jhodgdonUm, is this supposed to be a documentation issue, or a code fixing issue? It is currently in the Documentation component, meaning only documentation lines should be changed. So, this is not the right patch. Thanks!
Comment #8
joachim CreditAttribution: joachim as a volunteer commentedYup, this is about updating the docs.
Currently, the docs of these deprecated functions tell you to use something else, but that something else is *itself* deprecated. Updated summary.
Comment #9
Vinay15Sorry for the wrong patch. I have tried to update the patch.
Comment #10
Vinay15Comment #11
jhodgdonThat looks like the right things are being patched. I'll let someone else review for accuracy. Meanwhile, a lot of lines are now going over 80 characters in the latest patch, so those lines need to be rewrapped... although if a line only has a * and the name of a class on it, and still goes over 80 characters, there is no way to rewrap it so you can just leave those. Thanks!
Comment #12
ashishdalviHi jhodgdon,
I have rewrapped all lines of above patch which exceding 80 characters.
Thanks.
Comment #13
jhodgdonThere is still at least one line in the patch that has a space at the end of the line, which will not be acceptable in the final patch.
And again, someone needs to review the patch for accuracy and completeness.
Comment #14
Vinay15I have updated the patch.
Comment #15
jhodgdonThe formatting of the patch looks good now, thanks!
Please, can someone else (such as perhaps @joachim, who reported the issue?) review the patch for accuracy? Thanks!
Comment #16
joachim CreditAttribution: joachim as a volunteer commented*sigh* The change record for this change is itself out of date:
It's EntityTypeBundleInfo as in the patch, not EntityTypeBundleManager.
What is the procedure for dealing with CRs with obsolete information?
Comment #17
joachim CreditAttribution: joachim as a volunteer commentedAll the changes in the patch look good to me.
Comment #19
jhodgdonRegarding out of date CRs, they should be edited. Either fix them or put a big bold note at the top saying "THIS IS OBSOLETE" and link to a more updated CR.
Back to RTBC as this is the usual Migrate test failure (which already has an issue).
Comment #20
alexpottFixing these deprecation notices is important - nice work.
Committed 5bd880c and pushed to 8.1.x and 8.2.x. Thanks!
I thought about asking for the actual implementations to be updated as it looks weird - but there are other issues for this AND it is important to have correct deprecation notices.