There are calls to entity_load and entity_create methods which are now deprecated in favour of \Drupal::entityTypeManager->getStorage('entity_type')->load() and \Drupal::entityTypeManager->getStorage('entity_type')->create();.

Additionally I have still found a few places where deprecated EntityManager is used.

I attach a patch for this.

Comments

tom_ek created an issue. See original summary.

tom_ek’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, metatag-remove_deprecated_entity_function_calls.patch, failed testing.

tom_ek’s picture

Fix to pass the tests.

damienmckenna’s picture

Status: Needs work » Needs review
damienmckenna’s picture

Lets see if the tests pass.

Status: Needs review » Needs work
damienmckenna’s picture

Issue tags: +Needs tests
StatusFileSize
new198.93 KB

skip this, wrong issue

damienmckenna’s picture

Issue tags: -Needs tests

Don't need additional tests, and skip the last message, it was on the wrong issue.

damienmckenna’s picture

damienmckenna’s picture

Here's the first error it runs into:

Fatal error: Call to undefined method Drupal\Core\Entity\EntityTypeManager::getBundleInfo() in metatag/src/Form/MetatagDefaultsForm.php on line 120

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new7 KB
new1.32 KB

WIP.

Status: Needs review » Needs work

The last submitted patch, 12: metatag-n2775441-12.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new571 bytes
new7 KB

Fixed a typoo.

Status: Needs review » Needs work

The last submitted patch, 14: metatag-n2775441-13.patch, failed testing.

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new7.38 KB
new828 bytes

"EntityManager has been split into 11 classes": https://www.drupal.org/node/2549139

This should solve the problem.

damienmckenna’s picture

Title: Replace deprecated entity_load and entity_create with apropriae methods » Replace deprecated entity_load and entity_create with appropriate methods

Status: Needs review » Needs work

The last submitted patch, 16: metatag-n2775441-16.patch, failed testing.

damienmckenna’s picture

damienmckenna’s picture

Status: Needs work » Needs review
StatusFileSize
new6.6 KB

  • DamienMcKenna committed 109750e on 8.x-1.x authored by tom_ek
    Issue #2775441 by tom_ek, DamienMcKenna: Replace deprecated core entity...
damienmckenna’s picture

Assigned: tom_ek » Unassigned
Status: Needs review » Fixed

Committed. Thanks for bringing this to my attention, tom_ek!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

damienmckenna’s picture