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

\Drupal\Core\Plugin\Context\EntityContextDefinition::getSampleValues() needlessly generates full sample entities

$
0
0

Problem/Motivation

When evaluating plugin contexts, the context definition provides sample values for its context to use during comparison.

For entity contexts, this means creating an entity for each valid bundle.
Currently this uses \Drupal\Core\Entity\ContentEntityStorageInterface::createWithSampleValues(), which creates an entity and fills in sample values for every field.
However, those fields are not used during comparison, and are relatively expensive to create.

Proposed resolution

Switch from using a sample entity to a regular (empty) entity.

Remaining tasks

N/A

User interface changes

N/A

API changes

N/A

Data model changes

N/A


Viewing all articles
Browse latest Browse all 291765

Trending Articles



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