From 011d6e2b9e5a2dfcd87fa3f20b71aeb9509eb8f9 Mon Sep 17 00:00:00 2001 From: Nicolas Thouvenin Date: Fri, 4 Oct 2024 11:42:39 +0200 Subject: [PATCH] fix lodex field for lodex@14 with lodex@12 --- src/app/js/formats/lodex/field/LodexFieldView.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app/js/formats/lodex/field/LodexFieldView.js b/src/app/js/formats/lodex/field/LodexFieldView.js index bae1faffe..63cb18d30 100644 --- a/src/app/js/formats/lodex/field/LodexFieldView.js +++ b/src/app/js/formats/lodex/field/LodexFieldView.js @@ -226,19 +226,22 @@ export default compose( if (source.pathname.search(/(ark|uid):/) >= 0) { const [check, tenant = 'default', scheme, identifier] = source.pathname.split('/').filter(Boolean); let uri; + let pathname; if (check === 'instance') { // Lodex >= 14 uri = `${scheme}/${identifier}`; + pathname = '/api/export/format/jsonallvalue'; } else { // lodex <= 12 uri = source.pathname.slice(1); + pathname = '/api/export/jsonallvalue'; } const target = { protocol: source.protocol, hostname: source.hostname, slashes: source.slashes, port: source.port, - pathname: '/api/export/format/jsonallvalue', + pathname, search: `?uri=${uri}&tenant=${tenant}`, }; const newValue = URL.format(target);