Problem/Motivation

Once I configure my External Entity and I add the External Entity field in a content type I can see the list of my external entities in a select element, but when I try to create a node it doesn't works and I see the following error in the logs:

Drupal\Core\Entity\Query\QueryException: You must specify a single bundle for external entity queries. in Drupal\external_entities\Entity\Query\External\Query->prepare() (line 128 of /Users/adriancid/Sites/drupal83-test/modules/external_entities/src/Entity/Query/External/Query.php).

Proposed resolution

Remaining tasks

User interface changes

None.

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

adriancid created an issue. See original summary.

dpavon’s picture

I have a similar problem: I get that very same error whenever I try to create a new field for the external entity. The moment I set the field settings, this exception is thrown, and the form is not saved.

Related to: https://www.drupal.org/node/2907010

adriancid’s picture

I really don't know how we have 75 sites using this module, I tried many times to use the module in Drupal 8.3 and it does not works.

rp7’s picture

Steps to reproduce:

  1. Create at least 2 external entity types
  2. Add an external entity reference field to a content type (eg. admin/structure/types/manage/article/fields)
  3. When configuring the "Reference type", select at least 2 external entity types
  4. On the "Manage form display" page, select the "Select list" widget
  5. Edit a node
Wim Leers’s picture

Status: Active » Needs review
FileSize
3.22 KB

I think this can be solved by a custom @EntityReferenceSelection plugin. Several entity types in core already have this, for varying reasons, not too different from our reason here (single bundle queries only).

Wim Leers’s picture

Issue summary: View changes
FileSize
250.8 KB

Screenshot proving this works, even with the "Select list" widget:

Wim Leers’s picture

Should we mark this Closed (won't fix) because of #2995140: External Entities 2.x?

rp7’s picture

Status: Needs review » Closed (won't fix)

@Wim Exactly. This is fixed in #2995140: External Entities 2.x