parent
010249e49b
commit
a05134e903
2 changed files with 8 additions and 1 deletions
|
@ -1230,7 +1230,7 @@ Zotero.Search.prototype._buildQuery = Zotero.Promise.coroutine(function* () {
|
|||
var patterns = yield Zotero.DB.columnQueryAsync(ftSQL, { int: condition.value });
|
||||
if (patterns) {
|
||||
for each(str in patterns) {
|
||||
condSQL += 'mimeType LIKE ? OR ';
|
||||
condSQL += 'contentType LIKE ? OR ';
|
||||
condSQLParams.push(str + '%');
|
||||
}
|
||||
condSQL = condSQL.substring(0, condSQL.length - 4);
|
||||
|
|
|
@ -146,6 +146,13 @@ describe("Zotero.Search", function() {
|
|||
let matches = yield s.search();
|
||||
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 () {
|
||||
|
|
Loading…
Add table
Reference in a new issue