fix PHP8 fatals

This commit is contained in:
Steffen Müller 2023-03-12 13:50:28 +01:00
parent 7601038f6b
commit 8845ad65f0
3 changed files with 7 additions and 2 deletions

View File

@ -60,6 +60,11 @@ class Notification
$sql = "SELECT DISTINCT subscriberIDFK FROM services_subscriber WHERE serviceIDFK IN (" . $this->serviceids . ")"; $sql = "SELECT DISTINCT subscriberIDFK FROM services_subscriber WHERE serviceIDFK IN (" . $this->serviceids . ")";
$query = $mysqli->query($sql); $query = $mysqli->query($sql);
if (0 === $query->num_rows) {
// skip processing if no one needs to be notified
return;
}
// Create the queue tasks for email/telegram notifications // Create the queue tasks for email/telegram notifications
$queue = new Queue(); $queue = new Queue();
$queue->status = $queue->all_status['populating']; $queue->status = $queue->all_status['populating'];

View File

@ -114,7 +114,7 @@ class Queue
} }
// TODO: Fix max attempts for notifications // TODO: Fix max attempts for notifications
public function process_queue(){ public static function process_queue(){
global $mysqli; global $mysqli;
$stmt = $mysqli->query("SELECT qn.id, qn.task_id, qn.status, qn.subscriber_id, qn.retries, sub.firstname, sub.userID, sub.token FROM queue_notify AS qn INNER JOIN subscribers AS sub ON qn.subscriber_id = sub.subscriberID WHERE qn.status NOT LIKE 2 AND sub.active=1"); $stmt = $mysqli->query("SELECT qn.id, qn.task_id, qn.status, qn.subscriber_id, qn.retries, sub.firstname, sub.userID, sub.token FROM queue_notify AS qn INNER JOIN subscribers AS sub ON qn.subscriber_id = sub.subscriberID WHERE qn.status NOT LIKE 2 AND sub.active=1");
while ( $result = $stmt->fetch_assoc() ) { while ( $result = $stmt->fetch_assoc() ) {

View File

@ -153,7 +153,7 @@ class ServiceGroup
* Get list of services groups. * Get list of services groups.
* @return array $groups * @return array $groups
*/ */
public function get_groups() { public static function get_groups() {
global $mysqli; global $mysqli;
$stmt = $mysqli->query("SELECT id, name FROM services_groups ORDER by name ASC"); $stmt = $mysqli->query("SELECT id, name FROM services_groups ORDER by name ASC");