1
0
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:
Ryan Cramer
2021-08-04 12:44:40 -04:00
parent e4eed8358d
commit a6cd45ccff

View File

@@ -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");