From 9d04392eb0630a05cd0537234b106352f5cf00df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adomas=20Ven=C4=8Dkauskas?= Date: Mon, 26 May 2025 13:41:07 +0300 Subject: [PATCH] Add a read-only library param to /connector/getSelectedCollection Part of zotero/zotero-connectors#546 --- chrome/content/zotero/xpcom/server/server_connector.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/server/server_connector.js b/chrome/content/zotero/xpcom/server/server_connector.js index db046b4f22..ee73a433d2 100644 --- a/chrome/content/zotero/xpcom/server/server_connector.js +++ b/chrome/content/zotero/xpcom/server/server_connector.js @@ -930,7 +930,8 @@ Zotero.Server.Connector.GetSelectedCollection.prototype = { * @param {Function} sendResponseCallback function to send HTTP response */ init: function(postData, sendResponseCallback) { - var { library, collection, editable } = Zotero.Server.Connector.getSaveTarget(true); + let allowReadOnly = (postData.hasOwnProperty("switchToReadableLibrary")) ? !postData.switchToReadableLibrary : true; + var { library, collection, editable } = Zotero.Server.Connector.getSaveTarget(allowReadOnly); var response = { libraryID: library.libraryID, libraryName: library.name,