Steps to reproduce:

  1. Install Search API
  2. Search API Solr
  3. Create index on a node that's been set up
  4. Flush all caches

Offending line shown when flushing caches:

Notice: Undefined index: name in EntityMetadataWrapper->__toString() (line 159 of [...]/sites/all/modules/entity/includes/entity.wrapper.inc).

Tracking down line 159 I've changed the line from

return isset($this->info) ? 'Property ' . $this->info['name'] : $this->type;

to...

return isset($this->info) && isset($this->info['name']) ? 'Property ' . $this->info['name'] : $this->type;

...as this is a more failsafe check on $this->info['name'].

I guess it's expected that if $this->info exists then a key of name must exist also, but there is a nuance in the Search API which doesn't have the name key.

Patch to follow...

Comments

barry_fisher’s picture

Status: Active » Needs review
StatusFileSize
new477 bytes

Here's the patch

chris matthews’s picture

Issue summary: View changes

The 6 year old patch in #1 to entity.wrapper.inc applied cleanly to the latest entity 7.x-1.x-dev, but still needs review.