On the Add Fields page, my 'Content' entity type datasource has a 'Content type' field. This shows a + to indeicate it can be expanded.

Clicking this causes a crash with this message:

> LogicException: Getting the base fields is not supported for entity type Content type. in Drupal\Core\Entity\EntityFieldManager->buildBaseFieldDefinitions() (line 199 of core/lib/Drupal/Core/Entity/EntityFieldManager.php).

Comments

joachim created an issue. See original summary.

damiengr’s picture

Status: Active » Needs review
StatusFileSize
new1.38 KB

The "Content type" field is not supposed to be expandable as only the id should be indexable (It is a ConfigEntity).
When you click on the +, it tries to load the base fields because it is considered as a ContentEntity.
The lines checking if the property is not a ContentEntity are not checking the right object because it is being overriden few lines above.

Here is a patch that does check the right property object.

drunken monkey’s picture

Thanks a lot for the patch! Looks pretty good.
What was missing was a test ensuring this doesn't break again in the future, though – see the attached.

The last submitted patch, 3: 2737605-3--config_entities_not_indexable--tests_only.patch, failed testing.

The last submitted patch, 3: 2737605-3--config_entities_not_indexable--tests_only.patch, failed testing.

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reviewing!
Committed.
Thanks again also to Damien!

drunken monkey’s picture

Component: General code » User interface
Status: Fixed » Needs review
StatusFileSize
new2.14 KB

This just broke our tests. Let's see if it's really this patch, or just a Core change.

Status: Needs review » Needs work

The last submitted patch, 9: 2737605-9--config_entities_not_indexable--revert.patch, failed testing.

The last submitted patch, 9: 2737605-9--config_entities_not_indexable--revert.patch, failed testing.

drunken monkey’s picture

Status: Needs work » Fixed

OK, so it's unrelated. See #2749057: Fix broken Views date filter.

Status: Fixed » Closed (fixed)

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