With the content entity datasource's loadMultiple() (and, thus, load()) method it's possible to load entities that are not actually included in the datasource (since their bundle is excluded from it). I think this might make problems if a new node of bundle A is created just as an admin disables bundle A for the datasource. In any case, it makes sense conceptually to only load/return items that are actually in the datasource.

I also added an @todo comment to that effect to ContentEntity::loadMultiple.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

drunken monkey created an issue. See original summary.

drunken monkey’s picture

Category: Bug report » Task
drunken monkey’s picture

Issue tags: +Release blocker
drunken monkey’s picture

Patch attached, should be self-explanatory.

The last submitted patch, 4: 2574583-4--item_load_exclude_bundles--tests_only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 4: 2574583-4--item_load_exclude_bundles.patch, failed testing.

drunken monkey’s picture

borisson_’s picture

Status: Needs review » Reviewed & tested by the community

This looks great and has sufficient testcoverage. Great work!

drunken monkey’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for reviewing!
Committed.

  • drunken monkey committed b17eb80 on 8.x-1.x
    Issue #2574583 by drunken monkey: Fixed loading of entities from...

Status: Fixed » Closed (fixed)

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