Skip to content

Commit 9b3039d

Browse files
Fix issue with RepeaterPageArray lacking a makeNew() method.
1 parent e1c66b3 commit 9b3039d

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

wire/modules/Fieldtype/FieldtypeRepeater/FieldtypeRepeater.module

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,6 +1325,22 @@ class RepeaterPageArray extends PageArray {
13251325

13261326
return $page;
13271327
}
1328+
1329+
/**
1330+
* Creates a new blank instance of a RepeaterPageArray. For internal use.
1331+
*
1332+
* Note that this method has no relation/similarity to the getNewItem()/getNew() methods.
1333+
*
1334+
* @param array $items Array of items to populate (optional)
1335+
* @return WireArray
1336+
*
1337+
*/
1338+
public function makeNew() {
1339+
$class = get_class($this);
1340+
$newArray = new $class($this->parent, $this->field);
1341+
return $newArray;
1342+
}
1343+
13281344

13291345
}
13301346

0 commit comments

Comments
 (0)