Comments

Aron Novak created an issue. See original summary.

aron novak’s picture

Likely there's a nicer solution, User entity is likely not the only possible exception where the code should not only get getBaseFieldDefinitions

aaronbauman’s picture

Status: Needs review » Needs work

Looks good, thanks for the patch.
We can make this more robust: instead of hardcoding "user", let's use this approach for any entity type with only one bundle.

aron novak’s picture

Status: Needs work » Needs review
StatusFileSize
new939 bytes

How about this one?

According to https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21... ,
" outer array is keyed by the bundle name, or the entity type name if the entity does not have bundles", so as an edge case, we still have the "user" as we had previously, from the entity name.

aron novak’s picture

The previous patch had an unused variable.

aron novak’s picture

aaronbauman’s picture

Status: Needs review » Fixed

OK, finally fixed the unrelated test failure and committed.
Thanks for the patch

Status: Fixed » Closed (fixed)

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