The ConfigStorageController::loadMultiple() should use EntityInterface::id() function instead of trying to retrieve a public member. See DatabaseStorageController::loadMultiple() as example.

    // Ensure that the returned array is ordered the same as the original
    // $ids array if this was passed in and remove any invalid ids.
    if ($passed_ids) {
      // Remove any invalid ids from the array.
      $passed_ids = array_intersect_key($passed_ids, $entities);
      foreach ($entities as $entity) {
        $passed_ids[$entity->{$this->idKey}] = $entity;
      }
      $entities = $passed_ids;
    }

Comments

freblasty’s picture

Status: Active » Needs review
StatusFileSize
new686 bytes

Patch which uses EntityInterface::id() instead of retrieving id as a public member.

freblasty’s picture

Assigned: Unassigned » freblasty
tim.plunkett’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

I wouldn't really call this a bug... It's done in some EntityStorageControllerInterface::save() implementations by necessity, I'm guessing this was copy/pasted.

But the fix is correct and it still applies.

jibran’s picture

Status: Reviewed & tested by the community » Needs work
tim.plunkett’s picture

Status: Needs work » Needs review
freblasty’s picture

berdir’s picture

Wondering if this should be closed as a duplicate of #597236: Add entity caching to core, which moves the 3 identical snippets in the different loadMultiple() implementations into a helper method and solves this as well.

Status: Needs review » Needs work
freblasty’s picture

@Berdir will this issue be marked as duplicate or should I fix the patch?

berdir’s picture

Status: Needs work » Closed (duplicate)

That issue got in a while ago, so closing this now, yes.