From 1458c43012acef2e0ec3cbd6b8dafa769d18da48 Mon Sep 17 00:00:00 2001 From: amontenegro Date: Tue, 23 Jun 2026 16:33:07 -0600 Subject: [PATCH 1/2] PD-5749 Fix ext ids display on activities --- src/assets/print-view/fetch-orcid.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/assets/print-view/fetch-orcid.js b/src/assets/print-view/fetch-orcid.js index 7921b1d76..67c38856d 100644 --- a/src/assets/print-view/fetch-orcid.js +++ b/src/assets/print-view/fetch-orcid.js @@ -441,9 +441,10 @@ function otherIdsTextNode(label, value, url) { wrapper.appendChild(prefix) } + const safeUrl = sanitizeUrl(url) const valueAsUrl = sanitizeUrl(value) - if (valueAsUrl) { - // If the value itself is a URL, render it as a link and ignore the `url` parameter + if (safeUrl && valueAsUrl) { + // If both are provided and value is a URL, render value as the link wrapper.appendChild(document.createTextNode(' (')) const a = document.createElement('a') a.href = valueAsUrl @@ -453,10 +454,11 @@ function otherIdsTextNode(label, value, url) { wrapper.appendChild(a) wrapper.appendChild(document.createTextNode(')')) } else { - // Otherwise, keep the existing behavior: render value as text, + // Otherwise, render value as text, + if(value) + wrapper.appendChild(document.createTextNode(value)) + // and optionally append a (url) link if provided and safe - wrapper.appendChild(document.createTextNode(value)) - const safeUrl = sanitizeUrl(url) if (safeUrl) { wrapper.appendChild(document.createTextNode(' (')) const a = document.createElement('a') @@ -571,7 +573,7 @@ function composeActivityEntryFromJson(entry, opts = {}) { ? `${localizedRel} ${idType}`.trim() : idType || STRINGS.identifier wrapper.appendChild( - otherIdsTextNode(label, idValue || idUrl || '', idUrl) + otherIdsTextNode(label, idValue, idUrl) ) }) } From bccf40af694227610227e2b2d5a652ad5a4cdd61 Mon Sep 17 00:00:00 2001 From: amontenegro Date: Tue, 23 Jun 2026 16:38:30 -0600 Subject: [PATCH 2/2] PD-5749 run lin --- src/assets/print-view/fetch-orcid.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/assets/print-view/fetch-orcid.js b/src/assets/print-view/fetch-orcid.js index 67c38856d..455136703 100644 --- a/src/assets/print-view/fetch-orcid.js +++ b/src/assets/print-view/fetch-orcid.js @@ -455,8 +455,7 @@ function otherIdsTextNode(label, value, url) { wrapper.appendChild(document.createTextNode(')')) } else { // Otherwise, render value as text, - if(value) - wrapper.appendChild(document.createTextNode(value)) + if (value) wrapper.appendChild(document.createTextNode(value)) // and optionally append a (url) link if provided and safe if (safeUrl) { @@ -572,9 +571,7 @@ function composeActivityEntryFromJson(entry, opts = {}) { idRel && idRel.toLowerCase() !== 'self' ? `${localizedRel} ${idType}`.trim() : idType || STRINGS.identifier - wrapper.appendChild( - otherIdsTextNode(label, idValue, idUrl) - ) + wrapper.appendChild(otherIdsTextNode(label, idValue, idUrl)) }) }