From 989250ab0a91087a5709b3e377660059096c9e6f Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Wed, 14 May 2014 10:40:22 -0700
Subject: [PATCH] DD-95 : Prevent validation to run on folders that are not
 under the marketplace root

---
 indra/newview/llinventoryfunctions.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 283736f607f..a31edfe1839 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1100,6 +1100,12 @@ void validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
     LLViewerInventoryCategory * viewer_cat = (LLViewerInventoryCategory *) (cat);
 	const LLFolderType::EType folder_type = cat->getPreferredType();
     S32 depth = depth_nesting_in_marketplace(cat->getUUID());
+    if (depth < 0)
+    {
+        // If the folder is not under the marketplace listings root, validation should not be applied
+        // *TODO: Should we call update_marketplace_category(cat->getUUID()) ?
+        return;
+    }
     if (depth == 1)
     {
         std::string message = "Validating listing : " + cat->getName();
-- 
GitLab