From 5dbc50d6615eeb5a048788461523a3403121c1c1 Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 9 Jun 2026 14:43:53 +0300 Subject: [PATCH 1/3] Patch content indexing issue #869 --- .../uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java index 10763fb980..2efd0d3ad1 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java @@ -380,10 +380,10 @@ private void validateAndCacheContent(final Content flattenedContent, final Conte } log.info(CONTENT_LOG_PREFIX + "Resource with duplicate ID ({}) detected in cache. Skipping {}", - parentContent.getId(), treeWalkPath); + flattenedContent.getId(), treeWalkPath); this.registerContentProblem(flattenedContent, String.format( "Index failure - Duplicate ID (%s) found in files (%s) and (%s): only one will be available.", - parentContent.getId(), + flattenedContent.getId(), treeWalkPath, context.contentCache.get(flattenedContent.getId()).getCanonicalSourceFile()), context.indexProblemCache); @@ -448,8 +448,14 @@ private Content augmentChildContent(final Content content, final String canonica } augmentMediaFieldsViaReflection(content, canonicalSourceFile); - augmentMediaContent(content, canonicalSourceFile, parentId); + // Re-key this node to its fully-qualified id BEFORE generating an id for id-less media. + // An id-less figure has newParentId == bare parentId (no suffix added). If augmentMediaContent + // assigns it a generated id first, updateContentIdentifier's "id != null" guard then passes and + // clobbers that id with the bare parent id - colliding with the parent page's own id and pushing + // the real page out of the index (issue #869). Running the re-key first leaves id-less media null + // here (guard skips it), so augmentMediaContent can give it a unique id that survives. updateContentIdentifier(content, newParentId, parentPublished); + augmentMediaContent(content, canonicalSourceFile, parentId); return content; } From a5b32bec1af428aa71eed84751e8efbc3047870b Mon Sep 17 00:00:00 2001 From: Marius Date: Tue, 9 Jun 2026 17:09:57 +0300 Subject: [PATCH 2/3] Patch content indexing issue #869 --- .../java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java index 2efd0d3ad1..46bf762550 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java +++ b/src/main/java/uk/ac/cam/cl/dtg/segue/etl/ContentIndexer.java @@ -448,12 +448,6 @@ private Content augmentChildContent(final Content content, final String canonica } augmentMediaFieldsViaReflection(content, canonicalSourceFile); - // Re-key this node to its fully-qualified id BEFORE generating an id for id-less media. - // An id-less figure has newParentId == bare parentId (no suffix added). If augmentMediaContent - // assigns it a generated id first, updateContentIdentifier's "id != null" guard then passes and - // clobbers that id with the bare parent id - colliding with the parent page's own id and pushing - // the real page out of the index (issue #869). Running the re-key first leaves id-less media null - // here (guard skips it), so augmentMediaContent can give it a unique id that survives. updateContentIdentifier(content, newParentId, parentPublished); augmentMediaContent(content, canonicalSourceFile, parentId); From 2107146edaf171e34e0a6544eba405d16e652c8b Mon Sep 17 00:00:00 2001 From: Marius Date: Thu, 11 Jun 2026 17:03:41 +0300 Subject: [PATCH 3/3] Patch content indexing issue #869 --- .../ac/cam/cl/dtg/isaac/api/GameboardsFacade.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java b/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java index e49342961e..49d4f5770f 100644 --- a/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java +++ b/src/main/java/uk/ac/cam/cl/dtg/isaac/api/GameboardsFacade.java @@ -437,13 +437,6 @@ public final Response renameAndSaveGameboard(@Context final HttpServletRequest r @Produces(MediaType.APPLICATION_JSON) @GZIP @Operation(summary = "List all gameboards linked to the current user.") - private String sanitiseForLog(final String input) { - if (input == null) { - return "null"; - } - return input.replace('\r', '_').replace('\n', '_'); - } - public final Response getGameboardsByCurrentUser(@Context final HttpServletRequest request, @QueryParam("start_index") final String startIndex, @QueryParam("limit") final String limit, @@ -565,6 +558,13 @@ public final Response getGameboardsByCurrentUser(@Context final HttpServletReque return Response.ok(gameboards).cacheControl(getCacheControl(NEVER_CACHE_WITHOUT_ETAG_CHECK, false)).build(); } + private String sanitiseForLog(final String input) { + if (input == null) { + return "null"; + } + return input.replace('\r', '_').replace('\n', '_'); + } + /** * REST end point to allow gameboards to be persisted into permanent storage and for it to be added to the users' my * boards collection.