mirror of
https://github.com/processwire/processwire.git
synced 2025-08-11 17:24:46 +02:00
Fix issue processwire/processwire-issues#1313 WireArray::prepend(WireArray $items) adding in unexpected order
This commit is contained in:
@@ -977,7 +977,7 @@ class WireArray extends Wire implements \IteratorAggregate, \ArrayAccess, \Count
|
||||
|
||||
if(!$this->isValidItem($item)) {
|
||||
if($item instanceof WireArray) {
|
||||
foreach($item as $i) $this->prepend($i);
|
||||
foreach(array_reverse($item->getArray()) as $i) $this->prepend($i);
|
||||
return $this;
|
||||
} else {
|
||||
throw new WireException("Item prepend to " . get_class($this) . " is not an allowed type");
|
||||
|
Reference in New Issue
Block a user