Problem/Motivation-
Replace deprecated usage of entity_create('taxonomy_term') and entity_create('taxonomy_vocabulary') with a direct call to Term::create() and Vocabulary::create().
For reference,
https://api.drupal.org/api/drupal/core%21includes%21entity.inc/function/...

Proposed resolution-
Replace the deprecated call to entity_create() by a proper call to ::create().
Before:
entity_create('field_config', $field_values)->save();
After:
use Drupal\field\Entity\FieldConfig;
FieldConfig::create($field_values)->save();

Comments

jyoti.ohol created an issue. See original summary.

jyoti.ohol’s picture

jyoti.ohol’s picture

jyoti.ohol’s picture

jyoti.ohol’s picture

Assigned: jyoti.ohol » Unassigned
Status: Active » Needs review
kkalaskar’s picture

@jyotiohol

I tested 3048451_02_Replace_deprecated_usage_of_entity_create.patch it seems not working.

kailash.kalaskar@ASEN-D-AD052 MINGW64 /c/xampp/htdocs/d8-8/modules/contrib/redirect (8.x-1.x)
$ git status
On branch 8.x-1.x
Your branch is up to date with 'origin/8.x-1.x'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        3048451_02_Replace_deprecated_usage_of_entity_create.patch

nothing added to commit but untracked files present (use "git add" to track)

kailash.kalaskar@ASEN-D-AD052 MINGW64 /c/xampp/htdocs/d8-8/modules/contrib/redirect (8.x-1.x)
$ git apply 3048451_02_Replace_deprecated_usage_of_entity_create.patch
error: patch failed: src/Tests/RedirectUITest.php:353
error: src/Tests/RedirectUITest.php: patch does not apply

Please recheck it once.

kkalaskar’s picture

Status: Needs review » Needs work
jyoti.ohol’s picture

jyoti.ohol’s picture

jyoti.ohol’s picture

Version: 8.x-1.3
work fine for me.

jyoti.ohol’s picture

Status: Needs work » Needs review
maliknaik’s picture

Version: 8.x-1.3 » 8.x-1.x-dev
StatusFileSize
new2.61 KB
oleksandr yushchenko’s picture

Status: Needs review » Reviewed & tested by the community

Patch #12 applied successfully.

developer@trusty64:~/node8-env/modules/redirect$ git status
On branch 8.x-1.x
Your branch is up to date with 'origin/8.x-1.x'.

nothing to commit, working tree clean
developer@trusty64:~/node8-env/modules/redirect$ git apply -v ~/node8-env/patches/3048451.patch
Checking patch src/Tests/GlobalRedirectTest.php...
Checking patch src/Tests/RedirectUITest.php...
Applied patch src/Tests/GlobalRedirectTest.php cleanly.
Applied patch src/Tests/RedirectUITest.php cleanly.
berdir’s picture

Status: Reviewed & tested by the community » Fixed

Thanks, committed.

@oyushchenko, there is no reason to include a snippet that the patch applies. The passing tests prove that, it would fail otherwise.

  • Berdir committed 745efc7 on 8.x-1.x authored by maliknaik
    Issue #3048451 by jyoti.ohol, maliknaik: Replace deprecated usage of...

Status: Fixed » Closed (fixed)

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