When configuring the document repository to use a non-standard document UUID, e.g. MongoDB's native one (see configuration below), the search by ID gives weird results (children documents of searched document's parent folder if the document is a folderish, or a 404 for a non-folderish document) and does not open a new tab with the JSON export.
The MongoDB native UUID does not contain dashes, some document ID regexes in the code seem to break because of it.
How to reproduce:
- Fire up a LTS 2023 Nuxeo instance with a MongoDB document repository with the following XML contribution(or install the attached Marketplace package nuxeo-mongodb-native-id-package-1.0.0.zip):
<component name="default-repository-config-override"> <require>default-repository-config</require> <extension target="org.nuxeo.ecm.core.storage.mongodb.MongoDBRepositoryService" point="repository"> <!-- it will lookup for "repository/default" connection --> <repository name="default" label="label.default.repository"> <idType>sequenceHexRandomized</idType> <nativeId>true</nativeId> </repository> </extension> </component>
- create a File document in a workspace and retrieve its document ID
- open the browser extension and enter the document ID in the Search Repository field
Expected result: a new browser tab opens with the document's JSON export.
Actual result: No files found for DOCUMENT_ID error message in browser extension popup for a non-folderish document (or weird search results in the browser extension popup for a folderish document).
You can also check out Github repository https://github.com/vdutat/nuxeo-mongodb-native-id if you don't want to set up a Nuxeo instance and a MongoDB on your workstation.