I created field with type Entity Reference and selected exists Entity Type as Target type. Then I deleted this Entity Type, after that I see error when I'm trying to edit settings of this field to change Target Entity type to another:

EntityFieldQueryException: Entity <em class="placeholder">{entity_name}</em> has no base table. in EntityFieldQuery->propertyQuery() (line 1191 of includes/entity.inc).

So I should to remove this field and create new one instead of just edit exist field settings and change Target Entity type.
Files: 
CommentFileSizeAuthor
#1 1345340-entityreference-missing-entity-type.patch1.17 KBDamien Tournoud
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1345340-entityreference-missing-entity-type.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

Status:Active» Needs review
StatusFileSize
new1.17 KB
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 1345340-entityreference-missing-entity-type.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Here is a proposal patch to make the base selection handler more robust in this case.

Status:Needs review» Needs work

The last submitted patch, 1345340-entityreference-missing-entity-type.patch, failed testing.

Maybe we should have this logic already in entityreference_get_selection_handler() -- like this other modules implementing a selection handler don't need to take care of this?

Status:Needs work» Fixed

Merged into 7.x-1.x

This cannot be in entityreference_get_selection_handler() because there is no reason to impose that selection handlers only work on local entity types.

Status:Fixed» Closed (fixed)

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