diff --git a/core/model/DataObjectSet.php b/core/model/DataObjectSet.php index 1ed0c176ee7..7da57579a63 100644 --- a/core/model/DataObjectSet.php +++ b/core/model/DataObjectSet.php @@ -390,8 +390,8 @@ public function push($item, $key = null) { * @param string $key Key to index this DataObject by. */ public function insertFirst($item, $key = null) { - if($key != null) { - array_shift($this->items, $item); + if($key == null) { + array_unshift($this->items, $item); } else { // Not very efficient :-( $newItems = array();