mirror of
https://github.com/silverstripe/silverstripe-comments
synced 2024-10-22 11:05:49 +02:00
BUG: Fix infinite loop in requireDefaultRecords()
Calling nextRecord() returns the first record again and again, resulting in an infinite loop. Call next() instead.
This commit is contained in:
parent
bb0de16f36
commit
39cc3101a6
@ -132,7 +132,7 @@ class Comment extends DataObject
|
||||
$comments = DB::query('SELECT * FROM "PageComment"');
|
||||
|
||||
if ($comments) {
|
||||
while ($pageComment = $comments->nextRecord()) {
|
||||
while ($pageComment = $comments->next()) {
|
||||
// create a new comment from the older page comment
|
||||
$comment = new Comment();
|
||||
$comment->update($pageComment);
|
||||
|
Loading…
Reference in New Issue
Block a user