mirror of
https://github.com/processwire/processwire.git
synced 2025-08-12 09:44:38 +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(!$this->isValidItem($item)) {
|
||||||
if($item instanceof WireArray) {
|
if($item instanceof WireArray) {
|
||||||
foreach($item as $i) $this->prepend($i);
|
foreach(array_reverse($item->getArray()) as $i) $this->prepend($i);
|
||||||
return $this;
|
return $this;
|
||||||
} else {
|
} else {
|
||||||
throw new WireException("Item prepend to " . get_class($this) . " is not an allowed type");
|
throw new WireException("Item prepend to " . get_class($this) . " is not an allowed type");
|
||||||
|
Reference in New Issue
Block a user