To reproduce:
Go to Basic custom block type fields management and try to add an entityreference field...

Notice: Undefined index: type in Drupal\Core\TypedData\TypedDataManager->create() (line 131 of core/lib/Drupal/Core/TypedData/TypedDataManager.php).
InvalidArgumentException: Invalid data type <em class="placeholder"></em> has been given. in Drupal\Core\TypedData\TypedDataFactory->createInstance() (line 44 of /var/www/d8/core/lib/Drupal/Core/TypedData/TypedDataFactory.php).

Somehow in the $definition passed in TypedDataManager::create() there are only the field settings:/

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ParisLiakos’s picture

blueminds’s picture

Assigned: Unassigned » blueminds
ParisLiakos’s picture

Priority: Normal » Major

This makes entity reference useless when all entities become NG

amateescu’s picture

Assigned: blueminds » amateescu
Status: Active » Needs review
FileSize
3.95 KB
2.41 KB

It seems that this issue was already fixed in #1818556-120: Convert nodes to the new Entity Field API. I've extracted the fix from there and added a temporary test.

andymartha’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
49.62 KB
70.43 KB

I can confirm that on a fresh installation of Drupal 8.x-dev on March 6th, the problem described (entity reference crashing) was valid (see screenshot).
After applying 1935974.patch found in #4 by amateescu, I was able to successfully save an entity reference field to a custom block. See screenshot.

ParisLiakos’s picture

I can confirm that the patch fixes it:) that was quick, thanks all!

webchick’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: +SprintWeekend2013

My sincere hope is that nodes as entity NG is just around the corner, so this is an important fix to get put away sooner than later.

Committed and pushed to 8.x. Thanks!

ParisLiakos’s picture

Status: Fixed » Reviewed & tested by the community

this was never pushed

webchick’s picture

Status: Reviewed & tested by the community » Needs work

Huh, that's weird. And now that nodes as Entity NG is committed, this no longer applies. :(

amateescu’s picture

Status: Needs work » Closed (duplicate)

That's because this fix was already included in the nodes conversion patch :)