Fix when search scope path is the partition path
authorMathieu Baudier <mbaudier@argeo.org>
Mon, 11 Sep 2023 12:18:03 +0000 (14:18 +0200)
committerMathieu Baudier <mbaudier@argeo.org>
Mon, 11 Sep 2023 12:18:03 +0000 (14:18 +0200)
org.argeo.cms/src/org/argeo/cms/acr/CmsContentSession.java

index 832054e03bacaf1a1ec848523b87e66586922a9f..c782256e282acb94b97a7233ce0ddb4ad9d2cf0c 100644 (file)
@@ -210,12 +210,11 @@ class CmsContentSession implements ProvidedSession, UuidIdentified {
                                                : "scopePath=" + scopePath + ", contentProvider path=" + contentProvider.getKey();
                                // TODO deal with depth
                                String relPath;
-//                             if (scopePath.startsWith(contentProvider.getKey())) {
-                               relPath = scopePath.substring(contentProvider.getKey().length() + 1, scopePath.length());
-//                             }
-//                             else {
-//                                     relPath = null;
-//                             }
+                               if (!scopePath.equals(contentProvider.getKey())) {
+                                       relPath = scopePath.substring(contentProvider.getKey().length() + 1, scopePath.length());
+                               } else {
+                                       relPath = null;
+                               }
                                SearchPartition searchPartition = new SearchPartition(s, relPath, contentProvider.getValue());
                                searchPartitions.put(contentProvider.getKey(), searchPartition);
                        }