Salome HOME
updated copyright message
[modules/shaper.git] / src / Model / Model_FeatureValidator.cpp
index 794fc048f48dfcce5e9cec02cfd904ab3d414dfe..2417d79d6b85449c92364c75c07ba0be9c1d1ac3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2020  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -25,6 +25,7 @@
 #include <ModelAPI_Attribute.h>
 #include <ModelAPI_Data.h>
 #include <ModelAPI_Feature.h>
+#include <ModelAPI_FiltersFeature.h>
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Session.h>
 
@@ -59,7 +60,11 @@ bool Model_FeatureValidator::isValid(const std::shared_ptr<ModelAPI_Feature>& th
           aFeatureFind->second.find(*it) == aFeatureFind->second.end()) {
         theError = "Attribute \"%1\" is not initialized.";
         theError.addParameter(anAttr->id());
-        theError.setContext(theFeature->getKind() + ":" + anAttr->id());
+        // workaround for the filters selection feature: do not append the attribute id
+        if (std::dynamic_pointer_cast<ModelAPI_FiltersFeature>(theFeature))
+          theError.setContext(theFeature->getKind());
+        else
+          theError.setContext(theFeature->getKind() + ":" + anAttr->id());
         return false;
       }
     }