1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-28 12:30:42 +02:00

[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

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; $limit = 1000;
$sql = 'UPDATE ' . $this->tables['user_notifications'] . ' $sql = 'UPDATE ' . $this->tables['user_notifications'] . '
SET ' . $this->db->sql_build_array('UPDATE', ['method' => 'notification.method.email']) . " SET ' . $this->db->sql_build_array('UPDATE', ['method' => 'notification.method.email']) . "
WHERE method = 'notification.method.jabber'"; 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; return $this->db->sql_affectedrows() < $limit ? true : $start + $limit;
} }