From 141dc915d1227b2d2217a055bbb172f2ba766a63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferm=C3=ADn=20Gal=C3=A1n=20M=C3=A1rquez?= Date: Thu, 23 Nov 2023 11:24:05 +0100 Subject: [PATCH] FIX minor fixes --- src/lib/mongoBackend/MongoCommonUpdate.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/mongoBackend/MongoCommonUpdate.cpp b/src/lib/mongoBackend/MongoCommonUpdate.cpp index be35550e7b..cc5f16e4f7 100644 --- a/src/lib/mongoBackend/MongoCommonUpdate.cpp +++ b/src/lib/mongoBackend/MongoCommonUpdate.cpp @@ -3694,9 +3694,9 @@ static unsigned int updateEntity // searchContextProviders(tenant, servicePathV, en, eP->attributeVector, cerP); - if (!(attributeAlreadyExistsNumber && (action == ActionTypeAppendStrict))) + if (!((*attributeAlreadyExistsNumber) > 0 && (action == ActionTypeAppendStrict))) { - // Note that CER generation in the case of attributeAlreadyExistsError has its own logic at + // Note that CER generation in the case of attributeAlreadyExistsNumber has its own logic at // processContextElement() function so we need to skip this addition or we will get duplicated // CER responseP->contextElementResponseVector.push_back(cerP); @@ -4442,7 +4442,7 @@ unsigned int processContextElement } } - if ((apiVersion == V2) && (attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict)) + if ((attributeAlreadyExistsNumber > 0) && (action == ActionTypeAppendStrict)) { std::string details = "one or more of the attributes in the request already exist: " + eP->id + " - " + attributeAlreadyExistsList; buildGeneralErrorResponse(eP, NULL, responseP, SccBadRequest, details);