From 5b99ccf66279cbf7396d88385851fa592307c7ba Mon Sep 17 00:00:00 2001 From: wn_ Date: Tue, 8 Jul 2025 10:54:10 +0000 Subject: [PATCH] Use existing headline info for 'Article.displayUrl()' --- js/Article.js | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/js/Article.js b/js/Article.js index 694c7e616..a57454dec 100644 --- a/js/Article.js +++ b/js/Article.js @@ -123,15 +123,12 @@ const Article = { Article.setActive(0); }, displayUrl: function (id) { - const query = {op: "Article", method: "getmetadatabyid", id: id}; + const hl = Headlines.objectById(id); - xhr.json("backend.php", query, (reply) => { - if (reply && reply.link) { - prompt(__("Article URL:"), reply.link); - } else { - alert(__("No URL could be displayed for this article.")); - } - }); + if (hl?.link) + prompt(__("Article URL:"), hl.link); + else + alert(__("No URL could be displayed for this article.")); }, openInNewWindow: function (id) { /* global __csrf_token */