[ticket/17493] Improve handling of nullable start parameter

PHPBB-17493
This commit is contained in:
Marc Alexander 2025-04-20 07:58:53 +02:00
parent 27550ce59b
commit 54d8a49e70
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -101,14 +101,14 @@ class remove_jabber extends migration
];
}
public function move_jabber_to_email_notifications(?int $start = 0)
public function move_jabber_to_email_notifications(?int $start)
{
$limit = 1000;
$sql = 'UPDATE ' . $this->tables['user_notifications'] . '
SET ' . $this->db->sql_build_array('UPDATE', ['method' => 'notification.method.email']) . "
WHERE method = 'notification.method.jabber'";
$this->db->sql_query_limit($sql, $limit, $start);
$this->db->sql_query_limit($sql, $limit, $start ?: 0);
return $this->db->sql_affectedrows() < $limit ? true : $start + $limit;
}