From 2bad55efc792b27153836e90389363b679297a87 Mon Sep 17 00:00:00 2001 From: Noah Hilverling Date: Thu, 10 Dec 2020 12:27:51 +0100 Subject: [PATCH] Fix runtime config updates not working for objects without zone refs #8533 --- lib/remote/apilistener-configsync.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/remote/apilistener-configsync.cpp b/lib/remote/apilistener-configsync.cpp index 3c1203498..627141166 100644 --- a/lib/remote/apilistener-configsync.cpp +++ b/lib/remote/apilistener-configsync.cpp @@ -74,7 +74,7 @@ Value ApiListener::ConfigUpdateObjectAPIHandler(const MessageOrigin::Ptr& origin String objZone = params->Get("zone"); - if (!Zone::GetByName(objZone)) { + if (!objZone.IsEmpty() && !Zone::GetByName(objZone)) { Log(LogNotice, "ApiListener") << "Discarding 'config update object' message" << " from '" << identity << "' (endpoint: '" << endpoint->GetName() << "', zone: '" << endpointZone->GetName() << "')" @@ -325,7 +325,11 @@ void ApiListener::UpdateConfigObject(const ConfigObject::Ptr& object, const Mess params->Set("name", object->GetName()); params->Set("type", object->GetReflectionType()->GetName()); params->Set("version", object->GetVersion()); - params->Set("zone", object->GetZoneName()); + + String zoneName = object->GetZoneName(); + + if (!zoneName.IsEmpty()) + params->Set("zone", zoneName); if (object->GetPackage() == "_api") { String file;