diff options
author | Andrew Dolgov <[email protected]> | 2021-02-13 10:10:44 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2021-02-13 10:10:44 +0300 |
commit | eec5871f5f0de01e7a4bf5ba69c81315a8ea88e3 (patch) | |
tree | 928772498847fd9d87357a13f8c36e669f8b30ae /js | |
parent | d3940b625962048b6a7f951ba76f872ce2c1f6d2 (diff) |
fail better if requested article URL is blank
Diffstat (limited to 'js')
-rw-r--r-- | js/Article.js | 4 | ||||
-rw-r--r-- | js/CommonFilters.js | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/js/Article.js b/js/Article.js index 61368dfed..f8b0415b9 100644 --- a/js/Article.js +++ b/js/Article.js @@ -123,11 +123,13 @@ const Article = { Article.setActive(0); }, displayUrl: function (id) { - const query = {op: "rpc", method: "getlinktitlebyid", id: id}; + const query = {op: "article", method: "get_metadata_by_id", id: id}; xhrJson("backend.php", query, (reply) => { if (reply && reply.link) { prompt(__("Article URL:"), reply.link); + } else { + alert(__("No URL could be displayed for this article.")); } }); }, diff --git a/js/CommonFilters.js b/js/CommonFilters.js index 802cf478d..15403b8c4 100644 --- a/js/CommonFilters.js +++ b/js/CommonFilters.js @@ -332,7 +332,7 @@ const Filters = { } else { - const query = {op: "rpc", method: "getlinktitlebyid", id: Article.getActive()}; + const query = {op: "article", method: "get_metadata_by_id", id: Article.getActive()}; xhrPost("backend.php", query, (transport) => { const reply = JSON.parse(transport.responseText); |