Fix title display when installing style via connector (broken in 0f1687f1c7
)
This commit is contained in:
parent
51996b537d
commit
11f8bd20d6
2 changed files with 10 additions and 6 deletions
|
@ -1030,13 +1030,13 @@ Zotero.Server.Connector.InstallStyle.prototype = {
|
|||
|
||||
init: Zotero.Promise.coroutine(function* (requestData) {
|
||||
try {
|
||||
var { styleName, styleID } = yield Zotero.Styles.install(
|
||||
var { styleTitle, styleID } = yield Zotero.Styles.install(
|
||||
requestData.data, requestData.query.origin || null, true
|
||||
);
|
||||
} catch (e) {
|
||||
return [400, "text/plain", e.message];
|
||||
}
|
||||
return [201, "application/json", JSON.stringify({name: styleName})];
|
||||
return [201, "application/json", JSON.stringify({name: styleTitle})];
|
||||
})
|
||||
};
|
||||
|
||||
|
|
|
@ -674,10 +674,14 @@ describe("Connector Server", function () {
|
|||
.createInstance(Components.interfaces.nsIDOMParser),
|
||||
doc = parser.parseFromString(style, "application/xml");
|
||||
|
||||
return Zotero.Promise.resolve(
|
||||
Zotero.Utilities.xpathText(doc, '/csl:style/csl:info[1]/csl:title[1]',
|
||||
Zotero.Styles.ns)
|
||||
);
|
||||
return Zotero.Promise.resolve({
|
||||
styleTitle: Zotero.Utilities.xpathText(
|
||||
doc, '/csl:style/csl:info[1]/csl:title[1]', Zotero.Styles.ns
|
||||
),
|
||||
styleID: Zotero.Utilities.xpathText(
|
||||
doc, '/csl:style/csl:info[1]/csl:id[1]', Zotero.Styles.ns
|
||||
)
|
||||
});
|
||||
});
|
||||
|
||||
var style = `<?xml version="1.0" encoding="utf-8"?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue