/**
   * The entity types that can have this trait.
   *
   * When empty, defaults to all entity types.
   *
   * @var array
   */
  public $entity_types;

This is a bit confusing when trying to understand how this system works, as the trait plugins get applied to, say, the product *type*, but have an effect on the products, and the value for this property in this example would be 'product'.

Maybe something like this:

The content entity types that can have this trait.

The bundle entities of the content entity type will reference the trait, and receive any fields it defines.

When empty, defaults to all content entity types.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

joachim created an issue. See original summary.

bojanz’s picture

Sounds good. Wanna create a patch so you can get commit credit?

joachim’s picture

Sure!

dhare23’s picture

Status: Needs review » Needs work

The patch didn't apply:

src/Annotation/p.patch.txt:10: trailing whitespace.
* The content entity types that can have this trait.
src/Annotation/p.patch.txt:13: trailing whitespace.
* The bundle entities of the content entity type will reference the trait,
src/Annotation/p.patch.txt:14: trailing whitespace.
* and receive any fields it defines.
src/Annotation/p.patch.txt:15: trailing whitespace.
*
src/Annotation/p.patch.txt:16: trailing whitespace.
* When empty, defaults to all content entity types.
error: corrupt patch at line 19

joachim’s picture

Status: Needs work » Needs review

I think there's something wrong with your setup. The patch just applied fine for me to the 8.x-2.x branch, and I don't see any trailing whitespace.

dhare23’s picture

Status: Needs review » Reviewed & tested by the community

It was my setup before, it applied successfully.

  • bojanz committed eb5122d on 8.x-2.x authored by joachim
    Issue #2886730 by joachim, bojanz: clarify description of...
bojanz’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks!

Status: Fixed » Closed (fixed)

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