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:/

Files: 
CommentFileSizeAuthor
#5 1935974-before.png70.43 KBandymartha
#5 1935974-after.png49.62 KBandymartha
#4 1935974-test-only.patch2.41 KBamateescu
FAILED: [[SimpleTest]]: [MySQL] 52,545 pass(es), 1 fail(s), and 1 exception(s).
[ View ]
#4 1935974.patch3.95 KBamateescu
PASSED: [[SimpleTest]]: [MySQL] 52,546 pass(es).
[ View ]

Comments

Assigned:Unassigned» blueminds

Priority:Normal» Major

This makes entity reference useless when all entities become NG

Assigned:blueminds» amateescu
Status:Active» Needs review
StatusFileSize
new3.95 KB
PASSED: [[SimpleTest]]: [MySQL] 52,546 pass(es).
[ View ]
new2.41 KB
FAILED: [[SimpleTest]]: [MySQL] 52,545 pass(es), 1 fail(s), and 1 exception(s).
[ View ]

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.

Status:Needs review» Reviewed & tested by the community
StatusFileSize
new49.62 KB
new70.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.

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

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

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!

Status:Fixed» Reviewed & tested by the community

this was never pushed

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. :(

Status:Needs work» Closed (duplicate)

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