parent
010249e49b
commit
a05134e903
|
@ -1230,7 +1230,7 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () {
|
||||||
var patterns = yield Zotero.DB.columnQueryAsync(ftSQL, { int: condition.value });
|
var patterns = yield Zotero.DB.columnQueryAsync(ftSQL, { int: condition.value });
|
||||||
if (patterns) {
|
if (patterns) {
|
||||||
for each(str in patterns) {
|
for each(str in patterns) {
|
||||||
condSQL += 'mimeType LIKE ? OR ';
|
condSQL += 'contentType LIKE ? OR ';
|
||||||
condSQLParams.push(str + '%');
|
condSQLParams.push(str + '%');
|
||||||
}
|
}
|
||||||
condSQL = condSQL.substring(0, condSQL.length - 4);
|
condSQL = condSQL.substring(0, condSQL.length - 4);
|
||||||
|
|
|
@ -146,6 +146,13 @@ describe("Zotero.Search", function() {
|
||||||
let matches = yield s.search();
|
let matches = yield s.search();
|
||||||
assert.deepEqual(matches, [foobarItem.id]);
|
assert.deepEqual(matches, [foobarItem.id]);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should search by attachment file type", function* () {
|
||||||
|
let s = new Zotero.Search();
|
||||||
|
s.addCondition('fileTypeID', 'is', Zotero.FileTypes.getID('webpage'));
|
||||||
|
let matches = yield s.search();
|
||||||
|
assert.sameMembers(matches, [fooItem.id, foobarItem.id]);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("#toJSON()", function () {
|
describe("#toJSON()", function () {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user