Follow-up to #2490966: [Meta] Replace deprecated usage of entity_create with a direct call to the entity type class
Problem/Motivation
According to #2346261: Deprecate entity_create() in favor of a <EntityType>::create($values) or \Drupal::entityManager()->getStorage($entity_type)->create($values), entity_create() function is now deprecated so we shouldn't use it anymore. When the entity type is known we should directly call <EntityType>::create(). When the entity type is variable, we should use \Drupal::entityManager()->getStorage($entity_type)->create($values);.
So we should replace all stray documentation references.
Beta phase evaluation
| Issue category | Task |
|---|---|
| Issue priority | Normal because it's just about code and docs cleanup and good practices |
| Prioritized changes | The main goal of this issue is DX, performance and removing documentation for code already deprecated for 8.0.0. (Direct calls to EntityType::create are better than generic calls to entity_create for readability) |
| Disruption | This change is not disruptive at all as it only replaces old documentation. |
Proposed resolution
Replace stray documentation references to entity_create().
Remaining tasks
| Task | Novice task? | Contributor instructions | Complete? |
|---|---|---|---|
| Create a patch | Instructions | Done | |
| Manually test the patch | Novice | Instructions | |
| Review patch to ensure that it fixes the issue, stays within scope, is properly documented, and follows coding standards | Instructions |
User interface changes
None.
API changes
None.
| Comment | File | Size | Author |
|---|
Comments
Comment #3
anya_m commentedComment #4
anya_m commentedComment #5
andypostThis patch looks combined with #2928930: Properly deprecate entity_create() and remove all occurrences
Comment #7
andypostClosing as duplicate of #2928930: Properly deprecate entity_create() and remove all occurrences
No reason to split this change into 2 issues