Skip to content
Snippets Groups Projects
Commit 50779f29 authored by daniel.nolde's avatar daniel.nolde Committed by fago
Browse files

Issue #2090007 by danielnolde: EntityDrupalWrapper::getIterator() throws PHP...

Issue #2090007 by danielnolde: EntityDrupalWrapper::getIterator() throws PHP error: EntityMetadataWrapperIterator::__construct() must be an array
parent 79d7dbe2
No related branches found
No related tags found
No related merge requests found
......@@ -1116,7 +1116,7 @@ class EntityListWrapper extends EntityMetadataWrapper implements IteratorAggrega
*/
public function getIterator() {
// In case there is no data available, just iterate over the first item.
return new EntityMetadataWrapperIterator($this, $this->dataAvailable() ? array_keys(parent::value()) : array(0));
return new EntityMetadataWrapperIterator($this, ($this->dataAvailable() && is_array(parent::value())) ? array_keys(parent::value()) : array(0));
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment