From f02f15ef2c90191710d6c8c8c36ecc26ab7eb7e9 Mon Sep 17 00:00:00 2001
From: Herman van Rink <rink@initfour.nl>
Date: Fri, 21 Apr 2023 22:51:47 +0200
Subject: [PATCH] Fix a null value passed in by the create new forms, which
 lack an id.

---
 interface/lib/classes/tools_sites.inc.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/interface/lib/classes/tools_sites.inc.php b/interface/lib/classes/tools_sites.inc.php
index 149a9fb67a..4ff2b4c75c 100644
--- a/interface/lib/classes/tools_sites.inc.php
+++ b/interface/lib/classes/tools_sites.inc.php
@@ -148,6 +148,10 @@ class tools_sites {
 	function getDomainModuleDomains($not_used_in_table = null, $selected_domain = '') {
 		global $app;
 
+		// Fix a null value passed in by the create new forms, which lack an id.
+		if ($selected_domain == null) {
+			$selected_domain = '';
+		}
 		$sql = "SELECT domain_id, domain FROM domain WHERE";
 		if ($not_used_in_table) {
 			if (strpos($not_used_in_table, 'dns') !== false) {
-- 
GitLab