Steps to reproduce:
- Install Search API
- Search API Solr
- Create index on a node that's been set up
- 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
Comment #1
barry_fisher commentedHere's the patch
Comment #2
chris matthews commentedThe 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.